<div dir="ltr"><div><div><div>Jason,<br><br>It was a small spurt of inspiration at the time. However I haven't finished developing the web app and haven't revisited the how I'm going to deploy it, as there is a few ways to skin the dancer cat.<br>
<br></div>I reckon you may have something though, the only time I did get it to work caused it to recurse until apache returned a http 300 (I think that was the error, was a little while ago).<br><br></div>I'll give it a whirl and let you know how I get on.<br>
<br></div>Leon<br></div><div class="gmail_extra"><br clear="all"><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><br><div class="gmail_quote">On Tue, Jan 1, 2013 at 11:22 AM, Jason Nicholls <span dir="ltr"><<a href="mailto:jason@mindsocket.com.au" target="_blank">jason@mindsocket.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hey Leon,<div><br></div><div>Did you get this sorted out?</div><div><br></div><div>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><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font face="courier new, monospace">RewriteEngine On</font></div><div><font face="courier new, monospace"># RewriteCond %{REQUEST_FILENAME} !-f</font></div>
<div><font face="courier new, monospace">RewriteCond %{REQUEST_URI} !/water/dispatch.cgi/.*</font></div><div><font face="courier new, monospace">RewriteRule ^/water/(.*) /water/dispatch.cgi/$1 [L]</font></div>
</blockquote><div><br></div><div>The cond I introduced was to avoid re-writing any requests with dispatch.cgi in them.</div><div><br></div><div><br></div><div>Jason</div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote"><div><div class="h5">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></div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
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></div></div>_______________________________________________<br>
PLUG discussion list: <a href="mailto:plug@plug.org.au" target="_blank">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" target="_blank">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><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><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>
</font></span></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></div>