Forum Moderators: phranque

Message Too Old, No Replies

RewriteRule script to subdomain

missing something

         

venice

7:11 am on May 22, 2007 (gmt 0)

10+ Year Member



I have a cgi script that is rewriting to a directory...

RewriteRule ^directory/$ /cgi-bin/script.pl

I setup a subdomain and thought I could redirect the same way but it's not working.

RewriteRule ^subdomain.domain.com/$ /cgi-bin/script.pl

Should I be changing settings in httpd.conf or is my above rewrite incorrect?

jdMorgan

12:24 pm on May 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



RewriteRule cannot "see" hostnames -- All it can see is the local URL-path, e.g. "index.html".

To examine or back-reference the hostname, use a RewriteCond to check the %{HTTP_HOST} server variable.

Jim