1829143 Members
2087 Online
109986 Solutions
New Discussion

apache -- plz help

 
SOLVED
Go to solution
Maaz
Valued Contributor

apache -- plz help

Dear Gurus

if someone provide the "FILENAME.HTML" instead of "filename.html" in the url, apache says "Not Found" i.e eg if i type "http://127.0.0.1/java.html" i will recieve a proper page, but if i type "http://127.0.0.1/JAVA.html" apache says:

Not Found

The requested URL /JAVA.html was not found on this server.
Apache/2.0.52 (Red Hat) Server at 127.0.0.1 Port 80
plz help me to configure the apache, so that apache serves the page, and ignore the case-sensitivity.
plz help me

Regards
Maaz
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: apache -- plz help

This is normal behavior.

You can get around this by creating soft links in the directory from the all caps name to the correct name.

Unix is case sensitive. Unix is not windows.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
njia_1
Trusted Contributor

Re: apache -- plz help

Hi Maaz

Create two files java.html and JAVA.html but with different contents. Then try http://127.0.0.1/java.html and http://127.0.0.1/JAVA.HTML

then you will have a better idea that Unix sees java.html and JAVA.html as two different files.
Maaz
Valued Contributor

Re: apache -- plz help

Thanks Dear SEP, and nija.

from
http://httpd.apache.org/docs/2.0/en/mod/mod_speling.html

Apache Module mod_speling
Description: Attempts to correct mistaken URLs that users might have entered by ignoring capitalization and by allowing up to one misspelling

Summary
Requests to documents sometimes cannot be served by the core apache server because the request was misspelled or miscapitalized. This module addresses this problem by trying to find a matching document, even after all other modules gave up. It does its work by comparing each document name in the requested directory against the requested document name without regard to case, and allowing up to one misspelling (character insertion / omission / transposition or wrong character). A list is built with all document names which were matched using this strategy.

If, after scanning the directory,

.no matching document was found, Apache will proceed as usual and return a "document not found" error.
.only one document is found that "almost" matches the request, then it is returned in the form of a redirection response.
.more than one document with a close match was found, then the list of the matches is returned to the client, and the client can select the correct candidate.

I found this(mod_speling) module in my httpd.conf file, but when i intentionally provide /javaa.html instead of /java.html in the url apache says "NOT FOUND". What I understand is that this module is responsible for mispeling, wrong character and capitalization issues.

Eagerly awaiting for the help
Regards
Maaz
Muthukumar_5
Honored Contributor

Re: apache -- plz help

You have to look at Error responses in httpd.conf file. Search as "default HTTP_.html.var"

You can edit # ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
to make your setting.

hth.
Easy to suggest when don't know about the problem!
njia_1
Trusted Contributor

Re: apache -- plz help

Hi Maaz

Will try to find it out for you tonight.
Ivan Ferreira
Honored Contributor

Re: apache -- plz help

I think that you can use mod_rewrite to make all requests lowercase:

http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

RewriteEngine on
RewriteBase /
RewriteMap insensitive tolower:
RewriteRule ^[\/]*(.*)$ /${insensitive:$1} [R,L]
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: apache -- plz help

Dear Muthukumar Many thanks for reply/help. Muthukumar I didnt get u, I mean if u can plz guide me Step-by-Step.

Dear njia, Thanks for the favor.

Dear Ivan Ferreira where should i put these lines into my .conf file ?

Second Dear Gurus not just i want apache to ignore capitals, but i want that if someone writes a /javaa.html instead of /java.html, apache will serve the right page, i.e /java.html.

Apache Module mod_speling
Description: Attempts to correct mistaken URLs that users might have entered by ignoring capitalization and by allowing up to one ******MISSPELLING****



Ivan Ferreira
Honored Contributor
Solution

Re: apache -- plz help

You can create a file in /etc/httpd/conf.d called mod_spelling.conf. In that file, put the configuration lines and reload apache.

CheckSpelling on
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
njia_1
Trusted Contributor

Re: apache -- plz help

Hi Maaz

Try Ivan's suggestion, that is what worked for me as well

thanks
Maaz
Valued Contributor

Re: apache -- plz help

Thanks Dear Ivan Ferreira for continous help and support ;)
Thanks Dear njia

Thanks Every1
Regards
Maaz