Enabling Clean URLs in Drupal on InMotion Hosting

In order to enable clean URLs in Drupal, your Apache server needs to be configured with the mod_rewrite module enabled. If you have access to your own LAMP server, then you need to make sure that you have that module enabled. I plan on writing about how I have been able to do that on my localhost LAMP server, but for right now I want to explain how to do this on a shared hosting service, such as InMotion Hosting, which is my hosting service.

First, you need to figure out whether your hosting service has enabled mod_rewrite, as you will not be able to access it directly yourself in that kind of an environment. In the case of InMotion Hosting, yes, they do have mod_rewrite enabled.

My problem, then, wasn't in getting my hosting service to enable the module--my problem was that I still couldn't enable clean URLs on a Drupal installation I was doing. A quick chat with tech support suggested that I add "RewriteEngine on" to my .htaccess file. I did a quick Google search to learn more, and I found this tutorial. I opened up my .htaccess file, added "RewriteEngine on" just below the "Options +FollowSymlinks" command, and the Drupal installation didn't throw errors anymore when I tried to enable clean URLs!

NOTE: There is probably a way to enable clean URLs by adding "RewriteEngine on" AFTER you have installed your Drupal site, but I couldn't figure out how. This only worked for me when I edited .htaccess BEFORE installing Drupal.