Clean URLs And Perl
One of those “Big Things”™ that most web applications do(or want to do) lately is have clean URLs. That means instead of going to Options +FollowSymLinks
RewriteEngine On
RewriteRule ^cat/(.+)/(.+)/(.+)/(.+)$ cat.cgi?$1=$2;$3=$4 [NC,L]
It took me a while, but I managed to get clean URL’s working for Path, too. Now if you want to play Path, whether you have an account or not, you can go to http://girasquid.com/path/play and, well, play.
However, there is a caveat here. Having a form with an action that’s actually a clean URL does…interesting things. In my case at least, it breaks and the POST data never gets sent to where it’s supposed to. After some googling, I seem to be the only one having this problem. Which probably means it’s just something I mistweaked somewhere. Here’s how I fixed my .htaccess to get it working, though:
ForceType cgi-script
After writing that piece of code, I just stripped the extension of .cgi off of the Perl scripts that would have data getting POST’d to them, and got rid of any RewriteRules that applied to things like
Leave a Reply