Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Are abc.com/123.html and abc.com/123 same URls for Google?

         

domenox

8:17 am on Jan 12, 2020 (gmt 0)

5+ Year Member



Hello,

I've shortened the URL from .htaccess by "removing" the file extension. But I was not sure if example.com/bloq/d.html and example.com/bloq/d are the same URLs for Google. So I've made a 301 redirect example.com/bloq/d.html example.com/bloq/d. Now I get the "too many redirects" which means they're the same link. But still not sure if Google accepts them so?

[edited by: goodroi at 12:25 pm (utc) on Jan 12, 2020]
[edit reason] Welcome to WebmasterWorld, please go read the rules :) [/edit]

buckworks

2:34 pm on Jan 12, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



"too many redirects" which means they're the same link


No, that's not what it means. It means you've got something circular going on with redirects that keep redirecting to each other instead of landing and staying on the desired destination page.

Please show us your code for the redirects, converted to "example.com" where necessary. Someone might be able to spot the issue.

I was not sure if example.com/bloq/d.html and example.com/bloq/d are the same URLs for Google.


They are different URLs for Google or any other spider.

JorgeV

3:16 pm on Jan 12, 2020 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



Hello,

What happens when you visit a .html URL of your site? are you correctly redirected to the "non" .html URL ?

Also, what about canonical URL tag ?

domenox

3:18 pm on Jan 12, 2020 (gmt 0)

5+ Year Member



Thank you very much for reply.

I've added following code lines to the .htaccess file to shorten the link or can say to avoid the file extension:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php

Then made a 301 redicrect as exemple.com/bloq/d.html exemple.com/bloq/d

domenox

4:12 pm on Jan 12, 2020 (gmt 0)

5+ Year Member



JorgeV,

I'm a beginner and I do it on my own website. Should I use canonical URL tag? Which link must be the canonical one?

domenox

4:15 pm on Jan 12, 2020 (gmt 0)

5+ Year Member



Just a small precision. I've also removed exemple.com/bloq/d.html from Sitemap. I mean, I've generated a new Sitemap, and there's no link with extension on it. I just worry about some backlinks for exemple.com/bloq/d.html.

not2easy

4:52 pm on Jan 12, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi domenex and welcome to WebmasterWorld [webmasterworld.com]

There is an important distinction between a canonical meta tag and a canonical rewrite that for most cases makes the canonical meta tag unnecessary. The canonical meta is for situations where your site shows the same content at different URLs and you want to chosse which page is indexed. This happens on WordPress sites and e-commerce sites frequently. That is different and separate from sending all requests to the canonical of your choice.

You may send all traffic to https://www.example.com/ or prefer to send it to https://example.com/ because you 301 redirect all file requests to one or another version of your site. The canonical meta tag is only a suggestion, which search engines may ignore. A 301 makes that tag optional except for the WP/e-commerce cases mentioned where you should use it. Also - very important to ensure that the order of your rules is correct so the same request is not processed under looping rules.

This old discussion may help you see the difference: [webmasterworld.com...]

This is the Google SEO forum, those .htaccess questions are most often answered in the Apache forum: [webmasterworld.com...]

lucy24

7:05 pm on Jan 12, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What you’re missing is a RewriteCond looking at %{THE_REQUEST} so the redirects don't go around in circles. There are other issues, but that’s the central one. Post in the Apache subforum for more help.

RedBar

11:07 am on Jan 13, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are abc.com/123.html and abc.com/123

Have you never entered this in your URL locator and viewed the results?