Forum Moderators: phranque
I would like to create an .htaccess that redirects like this:
domain.com >>>> www.domain.com/folderX/
www.domain.com >>>> www.domain.com/folderX/
subdomain1.domain.com >>>> subdomain1.domain.com/folderX/
subdomain2.domain.com >>>> subdomain2.domain.com/folderX/
... and so on.
My current index.htm does this by simply (meta) redirecting to ../folderX/index.htm. There must be a way to do away with this index.htm ile and handle the redirect with .htaccess. And that would be better for SEO, no?
Thanks in advance for any help.
1) Redirect domain.com --> www.example.com
and
2) Rewrite
.. www.example.com --> www.domain.com/folderX/
.. subdomain1.example.com --> subdomain1.example.com/folderX/
.. subdomain2.example.com --> subdomain2.example.com/folderX/
The first step is to do an external 301-Moved permanently redirect from example.com to www.example.com.
The second step is to internally rewrite all domains to the /folderX/ subdirectory.
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim