Hello everyone,
My 1st time around here. *handshake*
I had two questions... it would great if someone would help.
Question 1) I wanted to do a example.com 301 redirect to www.example.com . I looked around and found two sets of solutions...
SET 1)
RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,NC]
SET 2)
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,NC]
I also found a lot of web sites suggesting
RewriteRule ^(.*)$ http://www.example.com/$1
[L,R=301] instead of
[R=301,NC] I am confused which one of these to use and why? I have had real bad experience with htaccess and i wanna be as careful as I can be.
Question 2) I wanted to 301 redirect an entire contents of a folder (and sub-folder) and files to new domain
domain.com/folder-to-new-domain/files
to >> new-domain.com/files
domain.com/folder-to-new-domain/folder/files
to >> new-domain.com/folder/files
domain.com/folder-to-new-domain/folder/folder/files
to >> new-domain.com/folder/folder/files
etc etc
How do i do this with .htaccess?
Given the number of folder and files involved I would like to put individual htaccess files in each folder instead of one big htaccess file. is that possible? (i do not want to touch the htaccess file in the main public_html folder it will break my whole website)
Thanks in advance. :)
BookMarc
[edited by: jdMorgan at 11:28 pm (utc) on May 18, 2010]
[edit reason] please use example.com only [/edit]