Mobile app version of vmapp.org
Login or Join
LarsenBagley505

: Why does http://example.com equal http://example.com/? When I access http://example.com in a web browser, the browser adds a slash to the end of the URL and loads the page. The part that scares

@LarsenBagley505

Posted in: #CanonicalUrl #DuplicateContent #Url #UrlRewriting

When I access example.com in a web browser, the browser adds a slash to the end of the URL and loads the page.

The part that scares me is that duplicate content exists when one uses the command-line tool CURL to access the same domain with and without the slash. This means example.com/ doesn't redirect to example.com or vice-versa, and neither indicate its canonical. (both attempts return the exact same result).

Since practically every website has this issue including this one and mine, Does this mean that I shouldn't care about this duplicate content issue or is there something that can be done about this?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @LarsenBagley505

1 Comments

Sorted by latest first Latest Oldest Best

 

@Phylliss660

There's nothing to worry about here, since example.com and example.com/ are the same URL. The useragent has to include a path in the HTTP request (as per RFC 2616), so what it sends to the server will be GET / in either case.

If you add the verbose flag to CURL this is quite easy to verify:

$ curl -v example.com * Rebuilt URL to: example.com/ * Hostname was NOT found in DNS cache
* Trying xxx.xxx.xxx.xxx...
* Connected to example.com (xxx.xxx.xxx.xxx) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.38.0
> Host: example.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Wed, 19 Aug 2015 01:27:48 GMT
* Server Apache/2.4.7 (Ubuntu) is not blacklisted
< Server: Apache/2.4.7 (Ubuntu)
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=UTF-8
<
[Response]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme