URL with uppercase letters

Asked

Viewed 257 times

3

Is there any problem naming pages with high-box ?

ex: http://exemplo.com.br/Minha-Pagina.php

1 answer

7


No. There’s no problem.

But you should think about what will happen if a user tries to access http://exemplo.com.br/minha-pagina.php (all in lower case) ? Page not found or will open the same page?

According to the W3C (About HTML and Urls):

Urls are usually CASE-SENSITIVE, but there may be Urls (or parts of it) that nay are CASE-SENSITIVE. The users should always consider that urls are CASE-SENSITIVE.

However, we know that it is more difficult for the user to memorize which letters are uppercase or lowercase... it is simpler to type everything in one way (uppercase or lowercase).

So, thinking about what the user can type, it would be interesting to let the two pages be accessible, ie NOT CASE-SENSITIVE.

To avoid any problems with SEO (search optimization), define what the default URL format will be, and if the URL requested by the user is different redirect (with HTTP Status: 301 Moved Permanently) to the URL in the default format.

UPDATE: Example of PHP redirection with HTTP Status: 301 Moved Permanently.

$url_padrao = 'http://exemplo.com.br/Minha-Pagina.php';
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: $url_padrao" );
  • Can you give me a way to go deeper into this part of redirect ? is in . htacess?

  • I put the redirect code there in the answer. Any questions just ask.

Browser other questions tagged

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