Apache Rewrite Rules
- by Philip
I have moved my website from a Wiki to Wordpress and in the process, realised that I have broken links to some popular pages on my website. Is it possible to fix this with a rewrite rule?
I need the rule to redirect anything beginning with "^/wiki/(.+)$" to "/$1" but also replacing the "_" character used in MediaWiki slugs to "-" used in Wordpress slugs.
For example:
http://example.com/wiki/An_Example_Page
should be pointed to:
http://example.com/an-example-page
Is it possible to write such a rewrite rule?
Edit: It appears that Wordpress doesn't even care if the "/wiki/" part is removed - provided the slug matches, and that seems to be case-insensitive too. So all I need to do is change the "_" characters to "-" in the slugs.