How to change letters in namespace and make it case sensitive.

Category: Frontpage

InMotionFans
n/a Points
Asked:
2014-03-25 1:07 pm EST

Hits: 48
Hi, I want the site map should take capital ,small letters, special character in it and display it accordingly in site map, how do i can change its namespace. please tell, I want respond immediately.

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

JacobIMH
Staff
9,962 Points
2014-03-25 1:40 pm EST
Hello,

On Linux server's all folder and file names are case-sensitive after the domain name. So for instance trying to access:

http://example.com/test.htm


Or:

http://EXAmple.com/test.htm


Will pull up the same page. However if you change the case of the file or folder such as:

http://example.com/Test.htm


This would try to pull up a completely different file with a capital T in the filename by default.

It is not recommended to make your files case sensitive due to search engines and possible duplicate content, as they could index Test.htm, TEst.htm, TESt.htm etc... and believe that each page should be a separate entity. Also if your scripts are looking for a particular case of a file and you're forcing the server to be non case sensitive this could also lead to unexpected issues.

If you really wanted to go ahead and allow for any case to be type in for your file names, then if you have root access to your server, you can modify the Apache configuration for your site and add these rules to the <VirtualHost> entry for your domain:

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


Otherwise you'd need to implement these set of rules in your .htaccess file, and again while this works, it would not be recommended over simply choosing a consistent naming scheme and then sticking with all folders/files either being all lower case or not:

Options +FollowSymlinks
RewriteEngine On

RewriteRule ![A-Z] - [S=27]

RewriteRule ^([^A]*)A(.*)$ $1a$2
RewriteRule ^([^B]*)B(.*)$ $1b$2
RewriteRule ^([^C]*)C(.*)$ $1c$2
RewriteRule ^([^D]*)D(.*)$ $1d$2
RewriteRule ^([^E]*)E(.*)$ $1e$2
RewriteRule ^([^F]*)F(.*)$ $1f$2
RewriteRule ^([^G]*)G(.*)$ $1g$2
RewriteRule ^([^H]*)H(.*)$ $1h$2
RewriteRule ^([^I]*)I(.*)$ $1i$2
RewriteRule ^([^J]*)J(.*)$ $1j$2
RewriteRule ^([^K]*)K(.*)$ $1k$2
RewriteRule ^([^L]*)L(.*)$ $1l$2
RewriteRule ^([^M]*)M(.*)$ $1m$2
RewriteRule ^([^N]*)N(.*)$ $1n$2
RewriteRule ^([^O]*)O(.*)$ $1o$2
RewriteRule ^([^P]*)P(.*)$ $1p$2
RewriteRule ^([^Q]*)Q(.*)$ $1q$2
RewriteRule ^([^R]*)R(.*)$ $1r$2
RewriteRule ^([^S]*)S(.*)$ $1s$2
RewriteRule ^([^T]*)T(.*)$ $1t$2
RewriteRule ^([^U]*)U(.*)$ $1u$2
RewriteRule ^([^V]*)V(.*)$ $1v$2
RewriteRule ^([^W]*)W(.*)$ $1w$2
RewriteRule ^([^X]*)X(.*)$ $1x$2
RewriteRule ^([^Y]*)Y(.*)$ $1y$2
RewriteRule ^([^Z]*)Z(.*)$ $1z$2

RewriteRule .* - [E=changed:yes,N]
RewriteCond %{ENV:changed} ^yes$

RewriteRule (.*) http://example.com/$1 [R=301,L]


This would go through each individual letter in a folder/file request one by one and check if it's capital or not, and then proceed to the next letter. Again this is not as efficient as simply planning out the correct consistent case to use from the beginning.

Please let us know if you have any other questions at all.

- Jacob

You must login before you can post a comment about this answer.

Like this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!