Welcome to WebmasterWorld Guest from 54.224.200.104

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

mod rewrite help please

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

New User

5+ Year Member

joined:Oct 1, 2007
posts:19
votes: 0


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

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

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


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

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

New User

5+ Year Member

joined:Oct 1, 2007
posts:19
votes: 0


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.

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

New User

5+ Year Member

joined:Oct 1, 2007
posts:19
votes: 0


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

Cheers

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

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


How did you fix it?

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