2

If some pages on my website link to example.com and others link to example.com/, should I make sure that all internal links point to one version, or it doesn't matter?

2 Answers 2

2

The main question is what does your server do in that instance?

If the answer is when you visit:

/page

and

/page/

Does one redirect to the other? or do both resolve in the browser? If the latter, then you should investigate making them uniform, and resolving on one canonical url.

The reason is that /page and /page/ whilst the same from a content perspective, are not then the same from a URL perspective when requested. This could lead to people linking external to either one around the web, potentially diluting the page in the search results.

Update:

If you are talking about the homepage specifically, trailing slashes after the domain name don’t matter, and as such linking internally differently will have no impact on your site health.

https://www.seroundtable.com/google-trailing-slashes-url-24943.html https://ahrefs.com/blog/trailing-slash/

3
  • 2
    This is true if the question is about pages on the domain, i.e. example.com/page, but the way it is worded makes me think the OP could be talking about just links to the homepage, i.e. example.com. In that case, it doesn't matter if there is a trailing slash or not.
    – Jake 1986
    May 20, 2021 at 15:54
  • I stand corrected. my understanding was the same logic applies. apparently not: seroundtable.com/google-trailing-slashes-url-24943.html
    – Squiggs.
    May 21, 2021 at 7:56
  • As Jake1986 said, my question was about the homepage. Thank you to both of you for your kind help.
    – Greg98
    May 21, 2021 at 14:21
1

There is no need to be consistent. Links to your home page are 100% equivalent with and without the slash.

There is no way to make a valid HTTP request without a leading slash in the path. A (slightly simplified) request for your home page looks like:

GET / HTTP/1.1
Host: www.example.com

If your browser tried to make the request without the slash

GET  HTTP/1.1
Host: www.example.com

web servers would respond with a HTTP/1.1 400 Bad Request. As a result, browsers HAVE to send the slash when requesting the home page. If a home page URL, doesn't have the slash, browsers always add it implicitly to the request. There are no redirects, extra requests, or performance problems involved.

I prefer to use the trailing slash for home page URLs. Because the slash is required to be sent, the more correct URL for the home page includes the slash. It also makes the home page URL more consistent with every other URL on your site. Every URL path starts with a slash.

Other people prefer to leave the slash off their home page URLs. There is merit to the argument that every unneeded piece of punctuation is uglier, hurts user experience, and consumes bandwidth. Browser URL bars often hide both the https:// and the trailing slash on the home page, showing only domain name to users.

There are no serious repercussions from choosing to use the trailing slash in links to your home page or to omit it. There are no problems with choosing the trailing slash in some links and choosing to omit it in others.


Trailing slashes matter on subdirectory URLs. There is a difference between example.com/foo and example.com/foo/. Those URLs are fetched distinctly, could have different content, and would require redirects to canonicalize. The home pages of your domain and subdomains are the only URLs on your site for which there is no technical difference between the versions with and without the trailing slash.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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