Problem with setting Rewrite Directives

Posted February 28, 2014 2.8k 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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer
Ok I figured it out.

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