I'm trying to post a question on Stack Overflow, but I got the following error message:
Please add some context to explain the code sections (or check that you have not incorrectly formatted all of your question as code).
Here is an attempt to post in text therefore, with formatting removed:
Title:
.htaccess fail- using RewriteCond to make exception to file extension-removal snippet - posted in text
this is a .php file extension removal snippet, for displaying links online.
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+).php [NC]
RewriteRule ^ %1 [R,L]
this is where i make the exception
RewriteCond %{REQUEST_FILENAME} !^/PhP/?$
RewriteCond %{REQUEST_FILENAME} !^/forms/?$
RewriteCond %{REQUEST_URI} !^/PhP/?$
RewriteCond %{REQUEST_URI} !^/forms/?$
this is original snippet
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]
in this snippet, I want to exclude two directories- PhP & forms- as the snippet is apparently preventing me from database access, as all connect & config files lie in those directories- however, the above example is ineffective. the four Rewrite Cond in the middle section above, are attempting to make the exceptions, followed by (last 3 lines) the original snippet code. What am I doing wrong? Thanks in advance