Drupal 7 Clean URL FIX (Ubuntu, Open Atrium, Red Hat)

1. First

Verify that the .htaccess is present in your root folder (the folder that contains the index.php of your website).

For drupal the first few lines of the .htaccess file look like the following (don’t tell me that it is empty – it should not be empty):

# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.

  Order allow,deny

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

if you do not see these lines then something is wrong. Unzip the drupal 7 again and locate the .htaccess and copy it to your root (the location of your index file). Again, Drupal does come with a .htaccess file, there is no reason to copy and paste stuffs that you find online, unless you know what you are doing.

2. Second

Make sure that your server is reading the .htaccess file.

Open the .htaccess file type some random characters in it and save the file. Try to navigate to your website. You should get an internal server error:

If can see your site without a problem then your server is NOT reading the file.

3. Third

Open you apache2.conf or http.conf and change the AllowOverride directive:


to

THEN RESTART THE APACHE SERVICE (IMPORTANT).

4. Fourth

Fourthly, Now go and navigate to your website.

If you do get the internal server error that means that the server is now reading your .htaccess file. Go back to your .htaccess file and remove the random characters and save.

5. Fifth

Enable the "Clean URL" Feature

Now go back to your drupal admin and enable “CLEAN URL”


Comments

Thanks for this post.

A concise set of instructions that worked perfectly for enabling the Clean Url setting in Drupal 7 on Ubuntu 10 server.

One point to note for step three when using apache2 on Ubuntu is that the edit is done in /etc/apache2/sites-available/default for the default web site. Obviously if you have multiple sites you need to make the change for each one or altenatively place the settings in a global file.

Hello.. I have checked list the Enable CLean URLs on my admin panel Drupal 7… but on the frontpage is still shown me like this “http://sitename/node3″ so.. what I have to do? I want the frontpage look like “http://sitename/articles.html” more readeable ;).

Note : I have been using Ubuntu and Apache2

You will need to take a look at the path module:
http://drupal.org/project/path
http://drupal.org/node/113373.
For anything more advanced you will need to take a look at into mod_rewrite and .htaccess.

Hi thanks many thanks for your post.
Regards Bond :)

Okay, so what do I do if the server is not reading the file?

Clean URLs works of I use http://local_IP/directory/page after I changed the httpd.conf and doesn’t seem to mind changes to .htaccess, but as far as I can tell http://sitename/directory/page is not reading the .htaccess file…

On a completely unrelated note, is there a quick way to solve that annoying cannot write to “sites/default/files” issue? (Drupal 7.7)
Do they both have to something to do with where the site is actually hosted?

is sitename on a different server? Are you using the site through a host file pointing to your local server (using xampp or others)?
If it does not mind changes to the .htaccess file, it may be that the clean URL instructions are embedded within your server configuration file or simply the file is there but hidden. Some systems hide files that starts with “.”

Thanks for the walk through. Just what I was looking for. Found it on the drupal.org website.

Sorry, the comment form is closed at this time.