How To Remove Redundent ?p=1 From URL
So I had an issue where my pagination would append a ?p=1 to the end of a URL when moving from page 2 back to page 1. With the issue corrected so those links no longer get served, I do have to try and find a way to do a 301 redirect from those URLs to the proper URL so that the search engines can update those links.
I am on an Apache server, and I would like to be able to use RedirectMatch 301 to do this, however I do not think that it plays well with query strings.
RedirectMatch 301 (.*)?p=1 http://mydomain.com/$1
does not do the trick
I believe the solution is going to end up being that I use RedirectCond and Rewrite statements to make this work, however I do not know how to get this to redirect.
Can someone help me out with this? What I have so far gives me Internal Server Errors so obviously I am not on the right track yet.
RewriteCond 开发者_如何学Go%{REQUEST_URI} (.*)$
RewriteCond %{QUERY_STRING} ^?p=1$
RewriteRule ^.*$ http://devserver/$1 [L,R=301]
If someone can even point me toward a good tutorial on how to set this up would be helpful too.
RewriteCond %{QUERY_STRING} (^|&)p=1(&|$)
RewriteRule . http://devserver%{REQUEST_URI}? [L,R=301]
精彩评论