• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

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?
0
Geoff Millikan
Asked:
Geoff Millikan
  • 6
  • 2
1 Solution
 
jasonsbytesCommented:
ReWriteRule ^cgi-bin/global.telecom.t1shopper.pl(.*) tools/global.telecome.t1shopper2.php$1
0
 
Geoff MillikanAuthor Commented:
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

0
 
Geoff MillikanAuthor Commented:
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

0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
Geoff MillikanAuthor Commented:
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

0
 
Geoff MillikanAuthor Commented:
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.
0
 
Geoff MillikanAuthor Commented:
You misspelled the solution which caused me grief but your solution helped me along the way.  Thank you.
0
 
jasonsbytesCommented:
haha sorry...  my bad.  Also, I would normally just put that in .htaccess, but what you did is probably better.
0
 
Geoff MillikanAuthor Commented:
No worries, yah, having a .htaccess makes for a bunch of overhead.

Thanks again.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now