0

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.

1

1 Answer 1

2

Try using mod_alias in Apache.

For example:

# When someone visits "/" (root) actually take them to "/blog".
Alias / /blog
8
  • 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. Apr 30, 2012 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 Apr 30, 2012 at 2:52
  • Ignore the <br><br>, I was trying to space out my text, not use to this site yet. Apr 30, 2012 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. Apr 30, 2012 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 Apr 30, 2012 at 4:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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