I have a website, website.com, and it also happens to be accessible via website.ipage.com. Here’s what I need: All requests to http://website.com need to be sent to http://www.website.com. I have already managed this using the htaccess file below:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{http_host} ^website.com [nc]
RewriteRule ^(.*)$ http://www.website.com/$1 [r=301,nc]
Here’s what I can’t figure out how to do: All requests to http://website.ipage.com must also be sent to http://www.website.com EXCEPT for http://website.ipage.com/stats/ (the subfolder /stats/ must still be accessible via website.ipage.com).
I managed to modify the above htaccess file to redirect all requests to http://website.ipage.com to http://www.website.com by making the following changes:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{http_host} ^(website.com|website.ipage.com) [nc]
RewriteRule ^(.*)$ http://www.website.com/$1 [r=301,nc]
Which leaves me with only one question: how do I allow access to website.ipage.com ONLY if the request is trying to access the /stats/ subfolder?
Add before RewriteRule