SOLVED: Named URL still show as generic page-2

Hi

In the General Settings of each page, I changed the Browser Title and Folder to unique names. I saved the site, republished the whole site, and cleaned up my history yet I still see website.com/page-2 and so on
What should I do?

SOLVED: I remembered I can only use lowercase letters (also: no spaces or nonstandard characters).

Lower case is an option (at least on Apache). But spaces indeed must be replaced by hyphens or underscores.

2 Likes

I think itā€™s only domain names which are case-insensitive. Page and file names are case-sensitive ā€“ unless, I imagine, your webserver is running in case-insensitive mode (as my Mac is).

I use both lower and upper case in my files namingā€”for example to differentiate between parent and child pagesā€”and it works fine.

All that indicates, I think, is that your webserver is set to be case-insensitive. It doesnā€™t mean that all are. https://www.ibm.com/docs/en/sva/9.0?topic=configuration-support-urls-as-not-case-sensitive

Thanks for the link.

Strictly speaking, you are right. In the time of Web 1.0 lower case has been a must. Nowadays, case insensitivity on servers is widely used. I often see URLs of companies and publishing houses that use mixed cases.

If your hosting server is not set for case insensitivity, use only lower case. Or, ask your host to configure their server for case insensitivity

I beg your pardon. Case sensitive naming has been available on Unix servers since early on (pre Apache 1.0).
Unix and its nephew Linux are ā€œcase- sensitive OSā€™sā€. Windows, including IIS (the third most used web server), are not case-sensitive.

The reason itā€™s still considered best practice to not mix cases for URIā€™s is constancy. The same reason we donā€™t put are shopping cart buried in the pageā€™s footer or have our navigation midway down the page. Itā€™s all about user experience. Users are used to websites being in lowercase. You mix cases in the URL and people will start getting 404ā€™s.

Most pages on the Internet are going to be in all lowercase. When you create web pages, itā€™s best to always save all files as lowercase (including the file extension).
Thereā€™s a lot that you ā€œcanā€ do with URIs and URLs names.

There are also lots that you ā€œshouldnā€™tā€ do with these names.

So letā€™s be clear on this. The domain name portion of the URL, left and including the top level name(.com, .org, .edu, .net), by specifications is case insensitive. That means that EXAMPLE.COM, Example.com, and example.com are all treated the same and translate to example.com.
The remaining part of the URL the path/filename ā€œcanā€ technically contain most characters you want , including spaces.

This is a list of the reserved characters(not including space) that has a special meaning when interpreting the URL/URI. If you want to use them, you will need to % encode them. It best practice not to use reserved them as part of the path/file name.

: / ? # [ ] @ ! $ & ā€˜ ( ) * + , ; =

These character are considered Unsafe (including space). If you use them you will need to % encode them.

ā€œ < > % { } | \ ^ ` [ ]  ~ # 

You can also easily configure Apache to be case-insensitive. This would treat the entire URL path just like the domain name. ABC, Abc, and abc would be the same.

Since most of us donā€™t have access to the httpd.ini file you can do that in the htaccess file:

RewriteEngine On
CheckSpelling On 
CheckCaseOnly On

This relies on the CheckSpelling Module being loaded. Most of the time, it is. If that doesnā€™t work, you can try this:

RewriteMap tolowercase int:tolower  
RewriteRule ^(.*)$ ${tolowercase:$1}

Apache should automatically redirect all your URLs to lowercase ones.

4 Likes

Hey, Doug,

Thanks for this clarification. As usual, your input is most thorough and accurate. I was hoping that youā€™d post before meā€¦ :+1:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.