Amass

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 site.com/cat.cgi?org=2;jot=6 or something, you’d go to site.com/cat/org/2/jot/6 or something. This is all accomplished with some .htaccess magic, that looks something like this(for this example): 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 girasquid.com/path/login or something. That solved the whole problem.

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image