Drupal Clean URL's on Ubuntu Dapper

1. See following tutorials:

a. http://drupal.org/node/43783

b. http://www.debian-administration.org/articles/136

2. Case where drupal is not installed into the apache document root, but rather in a subdirectory, it is necessary to so specify in two places:

1. /var/www/drupal/.htaccess

# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.

RewriteBase /drupal
2. /var/www/dsn/sites/default/settings.php 

/** * Base URL (optional).
* * If you are experiencing issues with different site domains,
* uncomment the Base URL statement below (remove the leading hash sign)
* and fill in the URL to your Drupal installation.
...
* * It is not allowed to have a trailing slash; Drupal will add it * for you. */

# $base_url = 'http://www.example.com'; // NO trailing slash!
$base_url = 'http://localhost/drupal';

If you’re running Apache2 on Debian stable, in order to install the rewrite module you simply need to:

  # a2enmod rewrite

then follow directions and/or restart the webserver:

# /etc/init.d/apache2ctl restart  

Then (if you are working with a subdirectory that is at the same time a symbolic link) edit /etc/apache2/sites-enabled/000-default or the appropriate configuratin file, and add:

Options +FollowSymLinks     ### if necessary, may be there
AllowOverride All

 so that the following section ends up looking something like the following:

        <Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
#RedirectMatch ^/$ /apache2-default/
</Directory> 

(by default it will say AllowOverride None which will not allow use of .htaccess to override directives).


Thanks!

Thank man,

I've been trying to figure this one out for a while, didn't think to check in the site-enabled default file!

All working perfectly now on 9.04.

This works in Edgy

Thanks! This works in Edgy 7.10 as well. I never knew about /etc/apache2/sites-enabled/000-default

Thanks

I was struggling to get clean urls to work on drupal/ubuntu feisty fawn, but this worked for me - thanks. I had drupal in a subdirectory that's a symbolic link.

Thank's... I was searching

Thank's...

I was searching for hours to find a solution for clean url's in Drupal.
It's worked for me using Ubuntu Feisty Server.

That's great!

That's great!