Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have setup mod_rewrite and mod_alias on Apache2 on Debian (in a test server).

I have the following rewrite code in /etc/apache2/sites-available/default:

<Directory />
  Options FollowSymLinks
  AllowOverride All
  RewriteEngine on
  RewriteCond %{REQUEST_URI} !\.(php|html|css|js|gif|png|jpe?g)$
  RewriteRule (.*)$ /index.php [L]

I have the following alias code that is setup by default from the phpmyadmin package (loaded via apt-get install phpmyadmin and located in /etc/apache2/conf.d/phpmyadmin.conf):

Alias /phpmyadmin /usr/share/phpmyadmin

Everytime I load http://my.test.server/phpmyadmin, it goes to http://my.test.server/index.php and not the alias (which is bypassed/ignored?).

How do I setup an exclusion rule to allow aliases to pass through (even if the alias is setup in a different file?)

share|improve this question
up vote 3 down vote accepted

Exclude the URIs containing "/phpmyadmin/" if you don't want them redirected:

RewriteCond   %{REQUEST_URI}  !/phpmyadmin/.*
share|improve this answer
Thanks! That worked! – James Nine Mar 21 '12 at 22:06

Or just move the declaration of your Alias before Directory or Location

Alias /phpMyAdmin /var/(...)

<Location />
    RewriteEngine on
    # (...)

By the wa: use Location with url ('/'), not 'Directory'.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.