301 redirect wordpress ?page_id=xxx
I've been using this code to 301 redirect WP pages like this one: mysite.co.uk/?page_id=12983 to: mysite.co.uk/nicepagetitle/
RewriteCond %{QUERY_STRING} !^page_id=$ RewriteRule .* http://mysite.co.uk%{REQUEST_URI}? [R=301,L]
I'm not sure if this is correct and what's more Google is still showing these pages: mysite.co.uk/?page_id=xxx in my Webmaster tools under 开发者_如何学CHTML suggestions.
I will appreciate if you help me with this issue.
Use the firefox plugin Live Headers to check the return codes given by your server and the redirected URLs. It will tell you if the redirect is correctly set to 301. To debug htaccess rules, you'll have to access logs on your apache server that may or may not be easy for you to look at.
For the Webmaster tools problem, It could be that, or google has a cached version... welcome to the web!
If you wish to do this without using htaccess, canonical tags which are supported by google et. al. would also serve the same purpose of putting all the link juice to the prettier URL.
精彩评论