<div dir="ltr">Hey Leon,<div><br></div><div>Did you get this sorted out?</div><div><br></div><div style>I don't think you need the QSA flag as you're not replacing the query string. Here's an alternative you can try with your cond commented out just in case.</div>
<div style><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><font face="courier new, monospace">RewriteEngine On</font></div><div style><font face="courier new, monospace"># RewriteCond %{REQUEST_FILENAME} !-f</font></div>
<div style><font face="courier new, monospace">RewriteCond %{REQUEST_URI} !/water/dispatch.cgi/.*</font></div><div style><font face="courier new, monospace">RewriteRule ^/water/(.*) /water/dispatch.cgi/$1 [L]</font></div>
</blockquote><div style><br></div><div style>The cond I introduced was to avoid re-writing any requests with dispatch.cgi in them.</div><div><br></div><div><br></div><div style>Jason</div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Dec 17, 2012 at 12:59 PM, Leon Wright <span dir="ltr"><<a href="mailto:techman83@gmail.com" target="_blank">techman83@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Guys,<div><br></div><div>Been playing with Perl's Dancer web framework, it's rather nifty! I have hit a stumbling block with my Apache rewrite rule knowledge.</div><div><br></div><div>There is something wrong with this as it doesn't appear to rewrite</div>

<div><br></div><div><a href="http://host/water/foo" target="_blank">http://host/water/foo</a></div><div><br></div><div>to</div><div><br></div><div><a href="http://host/water/dispatch.cgi/foo" target="_blank">http://host/water/dispatch.cgi/foo</a></div>
<div>
<br></div><div><div style="font-family:arial,sans-serif;font-size:13px">Alias /water /usr/local/leon/DanceApp/public</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

<Directory "/usr/local/leon/DanceApp/public"></div><div style="font-family:arial,sans-serif;font-size:13px">   Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch</div><div style="font-family:arial,sans-serif;font-size:13px">

   Order allow,deny</div><div style="font-family:arial,sans-serif;font-size:13px">   Allow from all</div><div style="font-family:arial,sans-serif;font-size:13px">   AllowOverride None</div><div style="font-family:arial,sans-serif;font-size:13px">

   AddHandler cgi-script .cgi</div><div style="font-family:arial,sans-serif;font-size:13px"></Directory></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

RewriteEngine On</div><div style="font-family:arial,sans-serif;font-size:13px">RewriteCond %{REQUEST_FILENAME} !-f</div><div style="font-family:arial,sans-serif;font-size:13px">RewriteRule ^/water/(.*)$ dispatch.cgi/$1 [QSA,L]</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">ErrorLog  /var/log/apache2/water-error.log</div><div style="font-family:arial,sans-serif;font-size:13px">

CustomLog /var/log/apache2/water-access_log common</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">This works:<br><a href="http://10.2.0.66/water/dispatch.cgi/foo" target="_blank">http://10.2.0.66/water/dispatch.cgi/foo</a></div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">But this doesn't:</div><div style="font-family:arial,sans-serif;font-size:13px"><a href="http://10.2.0.66/water/foo" target="_blank">http://10.2.0.66/water/foo</a><br>

</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Which if my rewrite rule was correct should.</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">Any apache experts out there? The regex looks correct to me and I have tried a few other variations.</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">Leon</div><div>--<br>DRM 'manages access' in the same way that jail 'manages freedom.'<br><br># cat /dev/mem | strings | grep -i cats<br>
Damn, my RAM is full of cats... MEOW!!</div>
<br>
</div>
<br>_______________________________________________<br>
PLUG discussion list: <a href="mailto:plug@plug.org.au">plug@plug.org.au</a><br>
<a href="http://lists.plug.org.au/mailman/listinfo/plug" target="_blank">http://lists.plug.org.au/mailman/listinfo/plug</a><br>
Committee e-mail: <a href="mailto:committee@plug.org.au">committee@plug.org.au</a><br>
PLUG Membership: <a href="http://www.plug.org.au/membership" target="_blank">http://www.plug.org.au/membership</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jason Nicholls<br><a href="mailto:jason@mindsocket.com.au" target="_blank">jason@mindsocket.com.au</a><br>
0430 314 857<br>
</div>