• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • Last Modified:

Only lowercase filenames in Apache

Hi am logged in command line into my webserver (apache). Someone else set this server up and if you upload files with uppercase characters, it reports a 404 error.

I have a file that must be in mixed case letters. Any ideas on how to turn this uppercase thing off, or can I create some sort of alias so that if a user tries to access FileName.html, they get filename.html

Thanks!

0
haneedes
Asked:
haneedes
  • 4
  • 3
  • 3
  • +1
1 Solution
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi haneedes,

I was unaware that Apache began treating host filenames on unix systems as all lower case.  Are you sure that you've stated the problem correctly?


Good Luck!
Kent
0
 
haneedesAuthor Commented:
hey kent. i am sure its not apache that is doing this, but the webmaster (who is no longer with the company) did something and i dont know what it is.

i am investigating right now use htaccess to redirect the files. hope that works
0
 
TintinCommented:
Apache just obeys the underlaying OS/Filesystem in regards to case.

If you want to serve case insensitive files on a Unix system, look at the mod_letter.c Apache module:

http://programmer.lib.sjtu.edu.cn/apache/modules.html
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
haneedesAuthor Commented:
Thanks, thats not it. When I browse the directories, the files are there in mixed case. However, browsing that file in a browser reports a 404. When I try to browse the file in all lowercase, it also gives me a 404. I have to actually go in and rename it to all lowercase to get it to appear in my browser. I think the module or whatever doesnt convert the filename, only prevents me from using uppercase names.

 I did however create an htaccess file that redirects the user to the correct file. So I found a workaround.

0
 
TintinCommented:
When you say "browser the directories" do you mean from the command line?  
Is this on a Unix server?

The mod_letter.c module should do exactly what you need.  Having a redirect is a pretty clunky workaround.
0
 
haneedesAuthor Commented:
i mean browse the directory and yes i mean unix command line. I think i m not being clear. I want to turn off whatever is installed that causes this behavior.
0
 
TintinCommented:
That's very strange behaviour from Apache.
0
 
NopiusCommented:
Probably your apache uses mod_rewrite. Check your htaccess files and httpd.conf for RewriteRule and RewriteCond lines.
0
 
haneedesAuthor Commented:
YES!

I found it there:

 # Converts everything to lower case
    RewriteMap lowercase int:tolower
    RewriteCond %{REQUEST_URI} !^/$
    RewriteRule ^/(.*)$ /${lowercase:$1} [PT]

So all I need is to remove these lines?
0
 
NopiusCommented:
Just comment them with a pound sign and restart apache if it's httpd.cond.
0
 
NopiusCommented:
Just comment them with a pound sign and restart apache if lines are in httpd.conf
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now