URL with uppercase letters

3

Is there a problem naming high-end pages?

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

    
asked by anonymous 15.09.2016 / 17:23

1 answer

7

No. There is 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 lowercase)? Page not found or will it open the same page?

According to W3C (About HTML and URLs) :

  

URLs are usually CASE-SENSITIVE, but there may be URLs (or parts thereof) that not are CASE-SENSITIVE. Users should always consider urls as CASE-SENSITIVE.

However, we know that it is more difficult for the user to remember which letters are uppercase or lowercase ... it is simpler to type everything in a single (uppercase or lower case).

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

To have no problem with SEO, set the default URL format, 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: PHP redirect example 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" );
    
15.09.2016 / 17:42