Fix for Drupal Clean URL Test Failure

Social Share Toolbar

DrupalEnabling Clean URLs in Drupal means getting rid of the URL parameters in your URL. Instead of http://www.mydrupalsite.com/?q=aboutpage the visitor will see http://www.mydrupalsite.com/aboutpage.

I’ve run into the Clean URL Test failure a few times now since I’ve been using Drupal (not long). Both times the solution has been the same (prompting me to blog the issue as a reminder).

Both times I’ve encountered the problem, it’s been while building a new site for a client on a temporary domain. When setting up hosting for a client I usually set up a new hosting account on a shared server and reference it by IP address until I’m ready to point the DNS servers at it.

The problem I run into is that, since the server is shared, a folder name is appended to the IP address, such as http://1.2.3.4/~mysite . That folder name is the reason that the Clean URL test fails.

If you install Drupal into a subfolder of your domain, you have to uncomment the RewriteBase line in your .htaccess file and change “/drupal” to your subfolder name. After doing so, your Clean URL test should pass.