Problem with setting Rewrite Directives

February 28, 2014 1.2k views
Hi, I seem to be having some trouble with Apache Rewrite Directives. I put the following directives inside of my /etc/apache2/sites-available/default file: RewriteEngine on RewriteCond %{request_filename} -f RewriteRule ^(.*) $1 [L] RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L] When I did that they worked just the way I intended. Except that everytime I navigated to the phpmyadmin url I'd get a 500 error. So to solve this I added RewriteRule ^(phpmyadmin)($|/) - [L] However when I did that it seemed to have the effect of completely turning the rewrite engine off. This is the complete config for the directory " Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all RewriteEngine on RewriteCond %{request_filename} -f RewriteRule ^(?:phpmyadmin)($|/) - [L] RewriteRule ^(.*) $1 [L] RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L] " Any help would be appreciated.
1 Answer
Ok I figured it out.

Simply putting the
"RewriteRule ^(?:phpmyadmin)($|/) - [L] "
last seemed to do the trick.
Have another answer? Share your knowledge.