I am attempting to rewrite a certain page (example.com/php/otherPages.php?pageSlug=example) to example.com/example.html while still displaying the content found on the said page. However I already have similar rewrite rules in my .htaccess that are messing with how the rule works. My code is below so you can better see what I'm talking about.
RewriteRule ^([^/\.]+)\.html?$ php/statePage.php?region_slug=$1 [L]
RewriteRule ^([^/\.]+)-tree-services/([^/\.]+)\.html?$ php/cityPage.php?region_slug=$2&state_slug=$1 [L]
RewriteRule ^([^/\.]+)-tree-services/([^/\.]+)/([^/\.]+)\.html?$ php/vendorPage.php?slug=$3®ion_slug=$2&state_slug=$1 [L]
RewriteRule ^([^/\.]+)-Sitemap\.xml?$ php/xmlState.php?region_name=$1 [L]
RewriteRule ^([^/\.]+)\.html?$ php/otherPages.php?pageSlug=$1 [L]
The top 4 rewrite rules work however the bottom one (the rule that is supposed to execute what is explained above) doesn't. When I take the bottom rule and place it at the top it works however, the rest of the code doesn't. I have determined that this is because ^([^/\.]+)\.html?$ is the same throughout the file. Is there any way to fix this or another code that I can put in that will function in the same way that I want it to function?
Thank you for any and all help,
Eric