I have a web application with multiple pages. The .htaccess file redirects everything after the domain-name.com/ to my index.php file, which processes the input and renders the appropriate page.
However, I also have some actual directories under domain-name.com/ which need to be excepted from the redirect. For example, my PHPMyAdmin directory (/pma).
Everything was working fine until I added the line to redirect reports/[name] to the index page also. Now, my /pma doesn't go to the PMA directory and instead goes to my app's index.php.
If I use /pma/index.php, it works, but it doesn't make sense why /pma would stop working with that one new rewrite rule.
Commenting out the RewriteRule for reports causes everything to work again.
I can't figure out why. Thanks for any help!
.htaccess file:
RewriteEngine On
# Redirect http to https (http://htaccesscheatsheet.com/#force-https)
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
# Ignore the following directories (don't remap to page engine)
RewriteCond %{REQUEST_URI} !^\/(pma*|css)
#Redirect all /reports/[report name] requests to index.php?page=reports/[report name]
RewriteRule ^reports/([a-z0-9\-_]+)\/{0,1}$ index.php?page=reports/$1 [NC,QSA,L]
#Redirect all /[pagename] requests to index.php?page=[pagename]&[querystring]
RewriteRule ^([a-z0-9\-_]+)\/{0,1}$ index.php?page=$1 [NC,QSA,L]
# Return .json files with the correct mime type (needed to support manifest.json)
AddType application/json .json