Link to home
Start Free TrialLog in
Avatar of Geoff Millikan
Geoff MillikanFlag for United States of America

asked on

Apache Rewrite rule?

I want all request to:

http://www.t1shopper.com/cgi-bin/global.telecom.t1shopper.pl

To be redirected to:

http://www.t1shopper.com/tools/global.telecom.t1shopper2.php

And preserve the query string.

What's the rewrite rule that will do this?
ASKER CERTIFIED SOLUTION
Avatar of Jason Minton
Jason Minton
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Geoff Millikan

ASKER

Thanks for the fast post but it doesn't work.  The below configuration doesn't cause the rule to run.  It is still pulling up the old page.


<Directory /home/t1shopper/www/cgi-bin>
RewriteEngine On
RewriteOptions Inherit
ReWriteRule ^cgi-bin/global\.telecom\.t1shopper\.pl(.*) tools/global\.telecome\.t1shopper2\.php$1 [QSA]
</Directory>

Open in new window

Changing the rule to look like this results in this entry in the error log:

script '/home/t1shopper/www/tools/global.telecome.t1shopper2.php' not found or unable to stat
<Directory /home/t1shopper/www/cgi-bin>
RewriteEngine On
RewriteOptions Inherit
RewriteBase   /tools
ReWriteRule ^global\.telecom\.t1shopper\.pl(.*) global\.telecome\.t1shopper2\.php$1 [QSA]
</Directory>

Open in new window

Tried it with the "T" flag and no luck - still getting "unable to stat"
ReWriteRule ^global\.telecom\.t1shopper\.pl(.*) global\.telecome\.t1shopper2\.php$1 [QSA,T=application/x-httpd-php-source]

Open in new window

Oh man, you've got to be kidding me!!  

In your solution above, you added an "e" in the name of the file I'm redirecting to.  I fixed the misspelling and my above solution works.
You misspelled the solution which caused me grief but your solution helped me along the way.  Thank you.
haha sorry...  my bad.  Also, I would normally just put that in .htaccess, but what you did is probably better.
No worries, yah, having a .htaccess makes for a bunch of overhead.

Thanks again.