Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I had a user http://www.example.com/forums for many years and very well index in the search engine. I have moved this to subdomain http://community.example.com and created another website example.com. Now how can I created permanent redirect for all the old indexing that I have in the search engine to go to the new address.

I found about 301 redirect in .htaccess but not sure how to do it.

Can you please advise?

I am on Linux with apache.

share|improve this question

migrated from stackoverflow.com Jul 16 '12 at 2:01

This question came from our site for professional and enthusiast programmers.

2 Answers 2

Add the following to the .htaccess. Htaccess redirect is better(faster) than the meta refresh or PHP redirect.

To redirect all pages, add the following to the .htaccess in the forums directory of http://www.example.com/

Redirect 301 / http://community.example.com/
share|improve this answer

If you're keeping the same file structure as your old site, I believe you can just do

Redirect 301 /forums http://community.example.com/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.