Strategerizer
El Presidente
Just Getting Started
Member Likes (0)
I am doing a new subsite for one of my clients. They have an existing (static HTML) website. Need to do 301 redirects for about 100 HTML pages to their corresponding new WP pages.
What I know so far is that I need to do 301 redirect, that these reside in the .htaccess file and the syntax is like this:
redirect 301 http://company-x.com/page1.html http://company-x/whatever-path/
Notice there is no automatic expression that can do the conversion from old to new path. Those redirects will need to be done line-by-line for all pages from the old website.
I see subsites do not have their own .htaccess. Would I need to put those hundred redirects in my main .htaccess? Is there a way to have a separate .htaccess for the subsite? Is there a better way?
Thanks!

Responses (3)
Sales & Support Pro (joined March 2010) Likes (0)
Hiya!
All the rules would need to go in the same .htaccess, yes.
However, you can use a RewriteCond condition to make them only apply to the subsite in question.
Thanks,
Phil
Member (joined October 2011) Likes (0)
Thanks Phil. I do not know about .htaccess syntax. Do you know what the sytanx would be for such a rule, to be applied for only company-x.com (using mapped domains) and needing to have this type of redirect:
redirect 301 http://company-x.com/page1.html http://company-x.com/whatever-path/
or maybe it needs to be something like:
redirect 301 http://company-x.com/page1.html http://company-x.master-site.com/whatever-path/
What exactly would I enter in the .htaccess file to limit the rules to that website?
Thanks!
Sales & Support Pro (joined March 2010) Likes (0)
I'm not familiar enough with mod_rewrite to be able to tell you exactly I'm afraid.
There are plenty of related resources online that should be able to help though, or you could seek a developer to do this for you.
Thanks
Become a member