subscribe
Call Us: (615) 772-0111

Godaddy .htaccess URL Extension Removal

Some of our lower-budget clients opt for using a shared IP host such as Godaddy.com. Not really a big deal, but it can come with its own set of issues, especially when it comes to URL re-writing using .htaccess files.

Here is the quick fix to 404 or 500 errors when dealing with a shared hosting plan on Godaddy.

Godaddy .htaccess URL Re-Write

Edit your .htaccess file to look like this:

Options -MultiViews
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]

#Just Change .php to whatever your extension is.

The simple key is to add a Options -MultiViews above the mod_rewrite.

This is what is happening behind the scenes.

htaccess MultiViews

If the server receives a request for “/directory/yourdirectory” and multiviews is enabled – if that directory does not exist, the server checks the directory for a file named “yourdirectory.*” and names all those files and assigns them the same media types as if the client asked for them by name. This needs to be disabled to ensure it does not look for the file extension.

If you see any errors, let me know and I’ll fix them.

See you soon!

9 Comments
  1. Nice useful post but you have a typo in your code that would cause the site to throw an error. Instead of “RewriteTrule” that should be RewriteRule. Godaddy can be such a pain in the ass. I ask clients to move if they’re hosted there.

  2. Thanks for the great tip. You’ve ended a several day frustration. Thanks again.

  3. Hi Matt,

    I’ve been looking all over the net trying to find a solution and finally came across this most recent post on the issue. I pretty much copied and pasted your code, changing out the .php to .html, uploaded to root, and it’s still not working. I’m still getting a 404 error.

    Any ideas? Here’s a link for example – greystaticmedia.com/welcome.html. Thanks for all your help.

  4. Thanks very much for this post. This is a recent change in which GoDaddy broke my site. Support, as is typical, I’m finding, offered no help. Only long hold times and a “we can’t help you, fix it yourself even if it was working before” refrain. Again, thanks a bunch.

  5. I’ve been trying to remove my url extensions for some months now via htaccess. Can anyone assist me? GoDaddy can’t help me.

  6. This code works great up, except when it comes to subdomains it throws an Internal Server Error.

    http://www.site.com/folder_for_subdomain/indexfile – works
    folder_for_subdomain.site.com/indexfile – Internal Server Error.

    Any fix around this?
    I should have forced my client to host through MT.. sigh…

Leave a Reply

Premium Wordpress Plugin