Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite help please

         

BassTeQ2

3:08 am on Mar 17, 2008 (gmt 0)

10+ Year Member



Hi all, I'm trying to redirect a request to another server if the querystring contains a keyword, "transformation"
I have my .htaccess setup as follows

RewriteEngine on
RewriteCond %{QUERY_STRING} transformation
RewriteRule (.*) [new-machine:8080...] [R=Permanent]

Now this works if I make a request from the htdocs dir eg
[old-machine...]

BUT when I try a request from the cgi bin, nothing happens
eg.

[new-machine...]

Any idea why this doesnt work for the cgi-bin?

Any help would be greatly appreciated.

Thank you

jdMorgan

5:58 pm on Mar 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is the cgi-bin a "real" subdirectory below the directory in which this .htaccess code resides?

If it is actually elsewhere in the filesystem, and is simply Aliased (see mod_alias) or ScriptAliased to appear to be in your directory structure, then your .htaccess won't necessarily apply when it's requested via HTTP.

Jim

BassTeQ2

12:58 am on Mar 18, 2008 (gmt 0)

10+ Year Member



Hi Jim, thanks very much for your reply.
Its a standard apache install, so the cgi-bin lives below the htdocs directory and is ScriptAilased to be in the directory structure.

Even if I copy the .htaccess file into the cgi-bin from htdocs it still doesn't work.

BassTeQ2

1:21 am on Mar 18, 2008 (gmt 0)

10+ Year Member



I've managed to get it working now, thanks again for your help!

Cheers

g1smd

2:35 am on Mar 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



How did you fix it?

Might be useful to the next person with the same question...