Forum Moderators: phranque
1. Which method do you use and why? ( do you redirect www.domain.com to domain.com or other way around and what are your reasons? )
2. What are the pro's and cons of creating such .htaccess rules? ( the good sides and downsides to not only each style but creating any kind of redirect or not ).
Would greatly appreciate any help. Is there a term which describes this process or re-direct as a google search off "non www" and such doesn't help much.
Thank you
3. Say I use a code like this:
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.domain\.com
RewriteRule (.*) [domain.com...] [R=301,L]
I have another site which is an add-on domain on my cpanel and the site is in the folder say: domain.com/site2/
If the .htaccess code is in domain.com/ .. why isn't the /site2/ folder effected. ( as it uses anotherdomain.com and the .htaccess in a folder above checks if the url is anything but www.domain.com
Hope I'm making sense.
Thanks
Add-on domains added via control panel are implemented by adding code to httpd.conf. Because requests for these domains are sent directly to the subdirectory in which the pages for that domain are stored, the .htaccess file for your main domain is not processed for these requests.
Jim