Forum Moderators: phranque
I also need it to rewrite anything.website.com to website.com.
For example I am wanting a script that if a user just types website.com, it will show them the contents of website.com/home. However, if they enter a subdomain (virtual) it will show them the contents of website.com
I have been experimenting with this, and have gotten the first thing to work, but when I tried the second thing, it gave me an infinite loop.
Thank you for any future feedback.
~JNCR
Options FollowSymLinks Indexes
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.website\.com [NC]
RewriteRule (.*) http://website.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^website\.com
RewriteCond $1 !^home/
RewriteRule (.*) http://website.com/home/$1 [L]
I thought this would work, but it doesn't.
This thread gives some starting clues [webmasterworld.com...] but will need several modifications.