: What should I do to notify Google of a switch from ".php" to extension-free URL's? I've implemented a simple mod-rewrite rule that internally rewrites urls without a file extension (that are
I've implemented a simple mod-rewrite rule that internally rewrites urls without a file extension (that are not directories) to .php files and removed the .php extension from all our internal links. I've also updated the sitemap with the extensionless urls. However, the urls in Google's index obviously still have the extension.
Will Google crawl the site or download the sitemap and update its
index automatically with the extensionless urls?
Should I be implementing a 301 redirect from .php to extensionless
urls? At the moment, both url's will resolve to the same page which
could be seen as duplicate content.
Should I get a list of all the urls in Google's index which have
extensions and submit a request to have them deleted via Webmaster
Tools?
More posts by @Shakeerah822
2 Comments
Sorted by latest first Latest Oldest Best
I recommend using 301 Moved Permanently redirect. Until then, if you're concerned that Google may categorize the pages as duplicate content then providing a sitemap or adding the rel=canonical link element into the head of each document should resolve the issue. If it is not possible to add the rel=canonical markup to the document, e.g. PDF, the recommendation is to append a Link: in the HTTP headers.
LINK Syntax Example:
<link rel="canonical" href="http://www.example.com/product"/>
HTTP Header Syntax Example:
Link: www.example.com/product; rel="canonical"
Yes, if you have your URLs redirected properly.
Yes. You should be using a 301 redirect instead of internally rewriting the URLs.
No, this is completely unnecessary. If your old URLs are 301 redirected to the new URLs, then Google will know that those resources have been permanently renamed/moved. That's the whole point of having a 301 redirect code (as opposed to using the other 3xx response codes).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.