Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I first launched my site, it I had MediaWiki in the root and a wordpress blog in a subfolder, /blog/.

After a while spammers took over the MediaWiki site and I had to remove it. The problem is I lost a lot of good content and inbound links from 3rd party sites.

My goal is to redirect the root folder to /blog/ while keeping the rest of the URL string intact. I have a Wordpress plug-in going that will automatically track the 404 errors. As these come in I'll be able to pull the old content from archive.org and give it a new home on a wordpress page.

share|improve this question
Are you using Apache? – Only Bolivian Here Apr 30 '12 at 2:16

Try using mod_alias in Apache.

For example:

# When someone visits "/" (root) actually take them to "/blog".
Alias / /blog
share|improve this answer
Clever. I would have gone straight to mod_rewrite, but this seems to be a perfect fit for the problem. But perhaps your example should illustrate how he mainly intends to use it, which would be to ensure /foo goes to /blog/foo and /foo/bar goes to /blog/foo/bar. – Lèse majesté Apr 30 '12 at 2:28
Do I drop these lines into the .htaccess file? <br><br> alias / /blog/ <br><br> I do I need the last / because there will be URL strings after there? Will this work too? redirect 301 / /blog – Jeffrey Henderson Apr 30 '12 at 2:52
Ignore the <br><br>, I was trying to space out my text, not use to this site yet. – Jeffrey Henderson Apr 30 '12 at 2:58
Just adding a line that says Alias / /blog in a single line will probably fix this issue for you. If it doesn't work, read about how to set it up using the link I posted. – Only Bolivian Here Apr 30 '12 at 4:24
@lesemajeste How would I do it with mod_rewrite?? I can get the home page to redirect but I can't get any of the old URLs to redirect. The old URLs all look like this: wikiprotest.com/index.php?title=Main_Page – Jeffrey Henderson Apr 30 '12 at 4:50

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.