I am running Red Hat Enterprise 4, Drupal 5.7, PHP 4.3.9, MySql 4.1.20.

I have installed mod_rewrite and it is working without any issues. I wanted to install mod_speling, because I am doing a conversion from Windows to Linux and some of the URLs are using incorrect case. It will also make it easier for users to create new links, because they won't have to worry about case. The issue i'm having is that the mod_speling does not want to work. Everytime I try a URL, I get pushed to the 404 page. I tested mod_speling without mod_rewrite and it works fine. It seems as though the two are conflicting with each other. Has anyone else seen this issue? Anyone have any idea on how to possibly fix it?

The only rewrite rules I have is:

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Thanks,
Shane

Comments

vm’s picture

your question isn't drupal specific and requires someone with a specific knowledge to answer thus you may have to wait an extended period of time. Otherwise you may want to start asking your question on apache related sites.

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

morbus iff’s picture

mod_speling only works on files and directories, not dynamic URLs created by a web application.

morbus iff’s picture

Ahhh, I see what you mean now.

Yes, they are conflicting. mod_speling works by waiting for a request, seeing if the file or directory doesn't exist, and then attempts its logic to find a similar file on the file system. Drupal's mod_rewrite entries, however, do much the same thing - they tell Apache that any request for *a non-existing file or directory* should be sent to Drupal to handle. This is "heavier" than mod_speling, and overrides it.

I don't think you can run the two in tandem and have them do what you'd like.

shanefjordan’s picture

Thank you for the info, it seemed as the mod_rewrite was taking precedence. I will just have to make it a big bold note in the training manual that things are case sensitive.

Thank you,
Shane

acouch’s picture

You can get this working with Apache by making sure that Drupal doesn't route any requests with the file extension you are worried about:

  RewriteCond %{REQUEST_FILENAME} !-f 
  RewriteCond %{REQUEST_FILENAME} !-d 
  RewriteCond %{REQUEST_URI} !.*\.(jpg|gif|png|JPG|GIF|PNG)
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

You lose the ability to have a nice "Page not found" message for those file extensions if they are not there but there is a performance gain for those missing resources as well.

Aaron Couch

drupal: DKAN
work: http://govdelivery.com
me: http://aaroncouch.info

dlomis’s picture

I was trying to use mod_speling to serve mixed case file names that had been uploaded to the server without using Drupal. I found that the requests failed when I kept mod_rewrite and mod_speling loaded. Although, I had commented out all of my mod_rewrite rules, mod_speling still didn't work. Only after I commented the LoadModule statement for mod_rewrite and restarted the server, did the file serve as I expected.

It seems to be a compatibility issue. Apache forums suggest using .htaccess files to configure the modules to work in specific and independent locations. Unfortunately, our configuration requires a need for mod_rewrites in the same location as we needed mod_speling. I am researching other alternatives for the mixed case issue. However, I am leaning toward a script to correct the filenames on the file system.

-Darren

Apache 2.2
RHEL 6
Drupal 7