The Linux Page

Clean URL not working on my Drupal site?!

Today I finally solved a problem that was bothering me for a while. A Drupal site I installed for a friend of mine would not accept the Clean URL set. This is when the URL does not need to include the rather ugly ?q=<path>.

The more I was looking into it and the more it looked like the problem was coming from the Apache installation.

Apache Installation

So I looked at the Apache configuration over and over again and I just could not see any problem!? Until something jumped to my eye: The DocumentRoot was correct and thus Apache did not tell me that was wrong, however, I use a <Directory> directive to make sure that only sites I choose to use specific features such as accessing the index.php and the .htaccess of Drupal for Drupal sites.

The fact is that this <Directory> directive used the wrong path. A path that did not even exist. But since it is used as a match against a potential path (it can even include patterns) Apache does not check to see whether that path exists.

So... that was it for me. Really, all my other websites were setup properly and worked just fine so it was really hard to find the error since I just couldn't believe that Apache would not work properly.

HostNine Clean URLs Support

Drupal Clean URLs work on HostNine.com, however, I spent hours trying to find out why it wouldn't work for me...

Somehow, they had emptied my .htaccess file (the one in the public_html folder). The file was there, just totally empty! Or maybe my FTP transfer did not send it... Hmmm... Needless to say, once I put the right content for the file, it started working as expected.

One thing though, they did not like the follow symbolic links option:

Options +FollowSymLinks

I had to comment that one line out and it accepted the whole thing just fine.

Annoying that I had to waste so much time on this one.