View Single Post
Old 7th March 2008, 07:16
thecaoticone thecaoticone is offline
Join Date: Nov 2007
Posts: 89
Thanks: 1
Thanked 18 Times in 16 Posts

First off, I told you wrong. The correct file is:




My apologies for that mistake.

You will need to load the rewrite_mod for apache:

sudo a2enmod rewrite

You also need to change AllowOverride from None to All in the first 2 directory blocks.

A better example for this is here:

Here is an example of /etc/apache2/sites-available/000-default using a rewrite for phpmyadmin.

If you do not use the default conf change to the conf you created for your main site.



DocumentRoot /var/www/mysite/

<Directory />
Options FollowSymLinks
AllowOverride All

<Directory /var/www/mysite/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# RedirectMatch ^/$ /apache2-default/

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error,crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from ::1/128

<IfModule mod_rewrite.c>
<IfModule mod_ssl.c>
<Location /phpmyadmin>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ [R]



Just a note, I came across this in the Squirrelmail configuration.

Let me know if this helped.
Reply With Quote