Fixing mod_rewrite and .htaccess on GoDaddy Hosting

Written by David Walsh on Thursday, November 5, 2009


I recently launched a new website on GoDaddy shared hosting. The website required mod_rewrite for SEO-friendly URLs. GoDaddy provides mod_rewrite but every time I tried to hit a two-deep URL, I would get a 404 error. Here’s what I had:

# Mod Rewrite
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

The fix to this problem was to add the following directive before my mod_rewrite directives:

#Fix Rewrite
Options -Multiviews

Tada! The URLs began working and the website’s SEO has taken off!


Follow via RSS Epic Discussion

php strip_tags(comment_author()) ?> November 05 / #
Rich says:

Is is true that it takes an hour for go daddy hosting to even know that there is an .htaccess file there? I launched one today, but godaddy wont read:

AddType application/x-httpd-php .htm .html
AddHandler x-httpd-php .htm .html

I went on google for help and found a site that said to use the above or use this:

SetHandler application/x-httpd-php

or

SetHandler application/x-httpd-php5

but negative on both. and on another blog it said it takes an hour.

I so hate godaddy hosting.

php strip_tags(comment_author()) ?> November 05 / #

Hey Rich!

I have been a GoDaddy Customer for quite some time now and I had the same problem you had.

It is not the .htaccess file – My files update within 3 minutes I use mod rewrite on my urls.

To get extensions to work you have to go in your hosting control panel and do it. I don’t understand why but that is the only way I can get it to work.

When you do that it will add what you put in it.

SetHandler application/x-httpd-php5 .htm .html on top of the file.

I hope this helped,
FreddyGonzalez.me

php strip_tags(comment_author()) ?> November 06 / #
Sexyone says:

Thanks for such a great advice!

php strip_tags(comment_author()) ?> November 06 / #
Rich says:

Thanks for that. Have to wait for the go ahead to make that happen. but that will definitely save me a huge headache. I appreciate it.

Be Heard!

I want to hear what you have to say! Share your comments and questions below.

Name*:
Email*:
Website:  


© David Walsh 2007-2009. Contact David Walsh. Powered by the remarkable MooTools javascript framework.