Drupal - Getting Clean URLs To Work With GoDaddy Shared Hosting

Submitted by Kenny on Fri, 04/23/2010 - 23:38
Category

If you're using GoDaddy for your web hosting and you've installed Drupal on your shared hosting (Economy, Deluxe, or Unlimited hosting plans), then you may have run into the issue where you can't enable Clean URLs for Drupal. Fortunately, there's an easy fix. Unfortunately, the fix is so easy, I'm not sure why GoDaddy hasn't fixed this.

In your FTP client or the file browser in GoDaddy's tools, navigate to the root where your Drupal instance has been installed and look for your .htaccess file. Look for this important line, noted in red:

#
# Apache/PHP/Drupal settings:
#
...

# Various rewrite rules.
<IfModule mod_rewrite.c>
 ...

 # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
 # VirtualDocumentRoot and the rewrite rules are not working properly.
 # For example if your site is at http://example.com/drupal uncomment and
 # modify the following line:
 # RewriteBase /drupal
 #
 # If your site is running in a VirtualDocumentRoot at http://example.com/,
 # uncomment the following line:
 # RewriteBase /

...
</IfModule>

# $Id: .htaccess,v 1.90.2.5 2010/02/02 07:25:22 dries Exp $

All you have to do here is delete the # in front of that line, which will uncomment that directive and allow Drupal to be able to successfully manage your site with Clean URLs. You will, however, have to enable it in your site configuration.

Don't forget to save your file after editing and best practice is that you should probably backup the .htaccess file before editing it.

See how easy that was? I wonder why GoDaddy hasn't fixed that yet. *shrug*

Sources: http://drupal.org/node/89089, http://drupal.org/node/364511

Note: I'm aware that there are several places on the web that this is explained, but it's important for GoDaddy users to know if they are using Drupal, so I thought I would add one more instance of this information to help spread the knowledge.