| Virtual Hosts and PHP
|
username

msg:4113782 | 8:06 am on Apr 11, 2010 (gmt 0) | Hi, so I have setup a site which uses virtual hosts. The site starts with login.example.com, and redirects if successful into anotherplace.example.com. Trouble is, is that I want the browser to detect if I enter http://www.example.com/login , where the vhost root directory is, and either generate a 404, or have it redirect to login.example.com, but am not sure how. So I am wondering what the best way to do this is, considering my include files point to the virtual hosts' root i.e. http://example.com/login/includes, and not the actual root. Is .htaccess the recommended option, or something else?
|
Readie

msg:4113832 | 12:01 pm on Apr 11, 2010 (gmt 0) | .htaccess should work. RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ RewriteRule ^login/?$ http://login.example.com [R=301,L] |
| However, I do advise getting the above checked in the Apache forums here on Webmaster World. [webmasterworld.com...] [edited by: eelixduppy at 1:42 am (utc) on Apr 12, 2010] [edit reason] formatting [/edit]
|
Readie

msg:4113863 | 1:59 pm on Apr 11, 2010 (gmt 0) | Unfortunately the target got parsed as a URL... http:// login.example.com
|
|
|