Hello, if we have use rewrite rule for pages which have query string in url, for example pagename.php?id=123 and i have write rule such a way page name is become pagename.html, now, when we write this url domainname.com/pagename.php?id=123 or domainname.com/pagename.html same page will be open. so my doubt is, Google will consider both the page as a different one and there is a chances of duplicate content penalty. Looking for some suggestion for this type of situation, i think all the webmaster are using rewrite rule for dynamic pages. thanks
Google will not index the page with the query string in the url if you forward it to another page. No reason to worry.
But one thing is there if we have put that link any where in the page and once that link will be crawled by the google they will index it. what do u think?? i m talking about link with query string.
i think u r not getting my question, i m not talking about permanent redirection, i m talking about redirect those url with query string to seo friendly name.
Yes i know, it's exactly as i said. If you change your URL's to static, a 301 Redirect will tell Google your dynamic pages are now .html and all old links pointing to the query string URL's should be forwarded to your new .html ones.
but, if we write old link in the browser than same page will open, it this case what should we do. will google have idea that this page is redirect to .html page so no need to consider it as a copy content... i think u r telling this..
Here is one way you can do this... Add the following line to your htaccess file redirect 301 /pagename.php?id=123 /pagename.html This will force a 301 redirect anytime an old URL is accessed. The problem here is if you have 1000's of pages you need 1000's of 301 redirects. Depending on your system you might be able to do some redirecting inside your application but without more info I cant really help you there sorry ALso, go to the effort of removing any of the old links from your site. Hope this helps
A 301 redirect will redirect any request for the dynamic page "pagename.php?id=123" to the static rewrite. If you type it in the browser window OR if Google tries to access the dynamic page, both will redirect to the static one. Google will see the redirect and consider it a replacement for the dynamic page. There will not be duplicate content.
Depending on what URL rewrite software you're using, it should work. Just check to make sure you have the write syntax.