So I am trying to migrate an old CMS that was custom done in 1996 to Wordpress. I have done the content import into Wordpress and now am ready to move the WP site from a subdirectory to the root. I just need help doing the 301 redirects. If anyone is good with this please help. Here is some examples of the old to new structure. News: Old: http://www.gamesite.com/index.php?page=globalnews New: http://www.gamesite.com/category/news/ Reviews: Old: http://www.gamesite.com/index.php?page=portal2&platform=&genre=&platform2=reviews New: http://www.gamesite.com/category/reviews/ Previews: Old: http://www.gamesite.com/index.php?page=portal2&platform=&genre=&platform2=previews New: http://www.gamesite.com/category/previews/ Articles: Old: http://www.gamesite.com/index.php?page=articles New: http://www.gamesite.com/category/articles/ Interviews: Old: http://www.gamesite.com/index.php?page=interviews New: http://www.gamesite.com/category/interviews/ ALso here is content: OLD: http://www.gamesite.com/index.php?page=gameportal&mode=reviews&id=556278 New: http://www.gamesite.com/staying-out-of-reach/ If you can help let me know. Thanks PS.. Domain name changed to protect..
You can add these rules in your .htaccess files.These rules will work for most of your URL but not for all because there is no method to determine new link on the basis of old URL(see your last URL).For those URLs you can add a custom rule for every URL or you can use PHP header("location:http://gamesite.com/newurl.php") to redirect. RewriteEngine on RewriteCond %{QUERY_STRING} ^platform2=(.+)$ RewriteRule ^index.php $ http://gamesite.com/category/$1? [L,R=301] RewriteCond %{QUERY_STRING} ^page=(.+)$ RewriteRule ^index.php $ http://gamesite.com/category/$1? [L,R=301] Code (markup):
Hey don't get confused if you don't how can write a rules in .htaccess Simply go to http://www.rapidtables.com/web/tools/redirect-generator.htm here you just define old url, new url and application or method to redirect and you will get code for it. Hope this will help you