Use or not use bar at the end of a URL?

Asked

Viewed 2,416 times

4

Whenever I will create a new website and think about the .htaccess me hit that question: force or not force the use of bar at the end of the URL.

For example: http://meusite.com would be 301-redirected to http://meusite.com/.

Doing this redirect, the load time may take a little longer, little I know, but each bit counts on a site of large proportions.

Not adding the final bar, however, can cause duplicate content in Google listings, and harm the site’s SEO.

So, definitely, should you or should you not use the bar at the end of a URL? And what are the main reasons?

3 answers

4

The idea that making a 301 redirect causes pagerank loss is a myth, and you have nothing to worry about. Any further answer will probably be a matter of personal opinion. As long as your urls serve the same content, whether or not it has the bar at the end.

  • +1 for whatever.

4


Using the rel="canonical", is at your discretion. Example:

I insert it into the head of the page, with the name of the original page in "href":

<link rel="canonical" href="http://www.exemplo.com.br" />

Then google will read, and if the content is equal, it will play all the ranking in the url that is in href, so on these pages below I have the rel="Canonical" directed to http://www.exemplo.com.br:

  • http://exemplo.com.br
  • http://www.exemplo.com.br
  • http://www.exemplo.com.br/
  • http://www.exemplo.com.br/index.html
  • Interesting! I think it’s good to be used one way or another, even with or without the bar at the end.

2

When it comes to the domain’s main URL, I think it’s unnecessary to put the bar at the end, since some browsers like Chrome already remove the bar automatically from the address bar: See the behavior when typing in the Chrome address bar:

http://localhost/

is automatically simplified to

localhost

However, there is a caveat as to which system is running on the server side, which may interpret the requested URL differently. For example a system may be using the URL and separating the bars for some internal use.

Example in PHP:

<?php print_r(explode('/', $_SERVER['PATH_INFO'])) ?>

http://localhost/index.php/modulo/

Print a first module item and a second empty item

http://localhost/index.php/modulo

Will print only a first item 'module'.

That is, because of SEO I do not think necessary, the systemic level depends on each case.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.