PDA

View Full Version : Case Insensitivity rewrite rule with .htaccess


deafboyzaudio
07-23-2010, 03:32 AM
I have been doing some research and havent turned up with a solid solution so I thought I would try out here....:mrgreen:

I have a need to ingnore case in my URL's....

I found some fixes to accept:

site.com/FakeFolderName/File

as a valid request for a directory/page that is actually named as:

site.com/fakefoldername/file

But that fix would require all filenames to be in lowercase and if a user typed uppercase it would be all good... NOT what I want....

Most my filenames are camel cased like :

site.com/thisIsAnExampleFileName

But not all of them are.....

basically i need a fix that will TOTALLY ignore case in the input url AND the actual filename..... Only then can it truly work for what I need,.....

Any knowledge?????:confused:

thanks...

deafboyzaudio
07-26-2010, 03:43 AM
anyone? Is my question clear?

My file names are like this on the server:

sitename.com/aboutDeafBoyzAudio (first letter of each word CAPITAL)

and i want the below address to be an accepted input to get to the above page:

sitename.com/aboutdeafboyzaudio (all lowercase)

EVEN general ideas on what might work are greatly appreciated....:mrgreen:

edbr
08-05-2010, 03:54 AM
this link might help some functions written there
http://php.net/manual/en/function.strtoupper.php

deafboyzaudio
08-17-2010, 08:40 PM
cool.... the strtolower() cool...seems like it would do the trick.... I can convert everything into lowercase... which is what anyone would type in a address bar 99% of the time...

I could not find any info on how to use that function in a .htaccess file....

Is it possible to tell .htacces to take each url and run it through strlower()???? it doesxnt have a .php extension so can i run php?

any ideas?

gentleone
08-17-2010, 10:09 PM
Just out of curiosity. Why are most of your filenames camel cased? Is there a special reason for that?

deafboyzaudio
08-22-2010, 05:10 AM
sorry for the late response....

Just out of curiosity. Why are most of your filenames camel cased? Is there a special reason for that?

Well no special reason.... this is the FIRST site i've ever made and i heard somewhere along the way that it would be a good idea.... so i went with it....

now that i've gotten into it i would do different.... but i have so many links and what not... its too late....

I have the function to covert all to lowercase now.... what is the best way to implement it in a .htaccess file????

I will seriously pay someone 20 bucks if they come up with a working solution....