Web Servers on Unix and Linux - rewrite to cgi script

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > May 2004 > rewrite to cgi script





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author rewrite to cgi script
Brian

2004-05-19, 8:41 pm

Hello,

I'm currently using rewrite to eliminate url suffix (see
< http://www.vandervossen.net/2003/07/clean_url >.

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.html [L]

This works fine on the site (url in sig if you want to see it in
action). Now, I'd like to add a separate rule to rewrite the target of a
search form that uses get. Instead of making the action e.g.,
"/cgi-bin/search.pl?q=lunch", I'd like to use
"/site/search/results?q=lunch". Is this possible to do?

I was not able to make it work. Here's a test case. My .htaccess now
includes this:

RewriteEngine on
RewriteRule /site/search/results(.*) /cgi-bin/hw.cgi [L]

The url http://www.tsmchughs.com/site/search/results produces a 500
server error. The script, however, works fine.

http://www.tsmchughs.com/cgi-bin/hw.cgi

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com