Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

For example if I have only one HTML page in my directory and if the link is http://www.mydomain.com/my-landing-page.html and, using .htaccess if I rewrite the URL to http://www.mydomain.com/my-landing-page, should I use canonical tag anywhere?

Or should I apply noindex, nofollow rule in robots.txt file for http://www.mydomain.com/my-landing-page.html?

I want my page look like http://www.mydomain.com/my-landing-page in search engines so, what should I do to http://www.mydomain.com/my-landing-page.html?

share|improve this question
1  
if it will remain that way (single file, static HTML page), you could as well create a folder named "my-landing-page" , and make your file "index.html". You can also define an 301-redirect to the folder, so you don't have to dealt with robots' or canonicals. –  halilpazarlama Oct 13 '13 at 3:29

1 Answer 1

If you 301-redirect from /my-landing-page.html to /my-landing-page, no one will ever get a 200 when visiting /my-landing-page.html. So you don’t need to do anything with this URL (besides redirecting). You shouldn’t block crawling of /my-landing-page.html, as otherwise bots may not notice that there is a redirect now.

You may use canonical for /my-landing-page. This could help in cases where URL variations show up (e.g., created by someone linking to your page) that still give 200 for your content.

Example (it depends on server configuration if this applies in your case): Someone might link to /my-landing-page?we-sell-only-crap. Thanks to the canonical, it’s now clear that this URL could be ignored.

 <!-- on /my-landing-page and variations  -->
 <link rel="canonical" href="http://example.com/my-landing-page" />
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.