GoDaddy mod_rewrite problem fix!

This problem has been bugging the crap out of me since I started using GoDaddy hosting. All of my old mod_rewrite stuff stopped working and I had to find roundabout ways to get mod_rewrite working. I talked to GoDaddy support which is usually great but they told me they couldn’t help. I scoured the tubes o’ internet and found lots of people with the same problem, but not too many answer, and none that worked for me…until today! The problem was that Apache MultiViews were enabled by default in GoDaddy hosting (at least in their shared hosting 2.0 environment).

Apache.org docs say the following about multiviews:

The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo< does not exist, then the server reads the directory looking for files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client’s requirements.

After I finally figured this part out, it was easy to disable. Just add the following to your .htaccess file in any directory which you do not want to use multiviews:

Options -MultiViews

So… this post is really just for random people scouring the internet tubes, probably not most of my normal readers…but it’s better than nothing.

Comment on “GoDaddy mod_rewrite problem fix!”

  1. Patrick Says:

    So i have been having the same problem and have scoured the internet tubes for solutions to this problem. I have tried them all and none of them worked. You gave me hope to think that your fix would also work…..however i am still without clean urls

  2. Brandon Says:

    That sucks…were you experiencing the same problems I described? I would suggest temporarily removing your htaccess file, then try navigating to a file of yours without the extension. Say, for instance, you have a file called http://www.test.com/tester.php - try going to http://www.test.com/tester and see if the page still comes up. If it does, and all of your mod_rewrite stuff is off, then MultiViews are on (like they were for me).

  3. Waldek Says:

    Thank You, Thank You, Thank You:)

  4. michael skramstad Says:

    I’m using the GoDaddy shared Linux plan and my .htaccess file isn’t working. Maybe their configuration has been changed. I want URLs that begin with http://mikeskramstad.com to redirect to the “www” version. Here’s the code:

    RewriteEngine on
    Options -MultiViews FollowSymLinks
    RewriteBase /

    RewriteCond %{HTTP_HOST} !^www\.mikeskramstad\.com$ [NC]
    RewriteRule ^/(.*)$ http://www.mikeskramstad.com/1 [R=301,L]

  5. Matt Says:

    Thanks for that. You are my hero.

  6. Sterling C Says:

    Oh man thank you so much…. i had bought an application and thought this issue had me beat!

  7. Can Says:

    Man thank you soooo much! I’ve been looking everywhere! Your solution finally ended my problems with GoDaddy!

  8. 0w3w Says:

    Man u are god!!!

    Thank’s!!! I was getting frustrated… and then puff! your magic post XD

    Thank’s!