Forum Moderators: phranque

Message Too Old, No Replies

Configuring sitemap/canonical after .htaccess rewrites?

Configuring canonical and sitemaps after .htaccess rewrite

         

Barton68

4:46 pm on Jul 16, 2010 (gmt 0)

10+ Year Member



Hi,

I just wondered if anybody could help me with a few configuration convention issues for sitemaps, canonicals and indexes etc?

I have written a website using PHP, and use an .htacces file to rewrite all .php files to .htm.
Also, had to redirect old page links to new locations, as all the page files were located in the root, now each page is located in a separate directory.

SITEMAP:
Q) Should the sitemap reference the original .php or rewritten .htm web pages?

WEBPAGES:
HTML Code:
<link rel="canonical" href="http://www.***.com/index.htm"/>
<link rel="index" title="***" href="http://www.***.com/index.htm" />

Q) Should the HTML code above reference .php or .htm?

I only as ask because after a month, Google Webmaster Tools hasn't index'ed the new links, but the new and old .php links are viewable in Google.co.uk

Thanks for any help,

Barton.

jdMorgan

1:20 am on Jul 17, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The sitemap should reference the URLs that you wish to appear in search engines.

> I have written a website using PHP, and use an .htacces file to rewrite all .php files to .htm.
This statement is either confusingly backwards, or dangerously wrong. I assume (and hope) that you are internally rewriting the .html URLs (that are requested by Web clients as a result of clicking on them as links on your pages) to your .php script's filepath.

If you have accidentally exposed .php filepaths as URLs to clients, then you will also need to redirect direct client requests for .php URLs back to the canonical .html URLs.

Jim

Barton68

2:04 pm on Jul 19, 2010 (gmt 0)

10+ Year Member



Many thanks for your response.