I have a testing web where there is a testing directory lets say ‘test’ which contains wordpress directory lets say ‘mywordpress’, test and his content – excluding the mywordpress – is handled by its own .htaccess – I need the .htaccess to do nothing with the url that goes mydomain.com/test/mywordpressXX (XX can be “/” or “/anything….”
Ive tried something but this .htaccess still works with test content, but throws Internal 500 error when I am trying to reach WP admin:
RewriteEngine On
RewriteBase /test/
DirectorySlash On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/.]+)$ $1/ [R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !/mywordpress/?$
RewriteRule ^([^/?]+)$ $1.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !/mywordpress/?$
RewriteRule ^([^/?]*)/([^/?]*)$ $1.php?$1=$2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !/mywordpress/?$
RewriteRule ^([^/?]*)/([^/?]*)/([^/?]*)$ $1.php?$2=$3
What am I doing wrong? Or how is it done correctly ?
Thanks.
Try this .htaccess:
Oh ! Silly me ! I forget about the RewriteBase /test/ you just have to make the exclude rule this way:
There was an additional slash:
RewriteCond %{REQUEST_URI} !/mywordpress/?$