Mobile app version of vmapp.org
Login or Join
Ravi8258870

: Should I have to use canonical if I rewrite my URL? 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

@Ravi8258870

Posted in: #CanonicalUrl

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

Or should I apply noindex, nofollow rule in robots.txt file for www.mydomain.com/my-landing-page.html?
I want my page look like www.mydomain.com/my-landing-page in search engines so, what should I do to www.mydomain.com/my-landing-page.html?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Ravi8258870

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

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" />

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme