1. See following tutorials:
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:
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
/** * 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
so that the following section ends up looking something like the following:
Options Indexes FollowSymLinks MultiViews
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/
(by default it will say AllowOverride None which will not allow use of .htaccess to override directives).