Forum Moderators: phranque
I have a main domain (www.example.com) and have setup a redirect so that anyone going to the above address will be directed to www.example.com/catalog. It works wonderfully, however now I am having a problem getting to my 2 subdomains
www.forums.example.com
www.vendors.example.com
if you type in those addresses you just get sent to the www.example.com/catalog address.
Here is my current setup for my root htaccess file:
Redirect permanent /index.php [example.com...]
does anyone know what I can do so that people can get to my subdomains but still have people going to www.example.com go to the /catalog?
I am at a total loss for how to fix this.
Thank you all!
RW (Doug)
[edited by: jdMorgan at 8:10 pm (utc) on Jan. 27, 2005]
[edit reason] Removed specifics. Please see TOS. [/edit]
Welcome to WebmasterWorld!
Bad news/good news.
The bad news is that you can't fix this using mod_alias (The Redirect directive and others).
The good news is that you can fix it with mod_rewrite, if you are allowed to use it on your server.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)example\.com
RewriteRule ^index\.php$ http://www.example.com/catalog/index.php [R=301,L]
See our forum charter [webmasterworld.com] for links to Regular Expressions and mod_rewrite documentation and tutorials.
Jim