1
votes

I have a application in the root directory of a website that has its own apache2 mod-rewrite rules e.g.

   RewriteRule ^/([^/]*)/([^/]*)/$ /index.php?page=$1&var1=$2
   RewriteRule ^/([^/]*)/$ /index.php?page=$1

Thats fine but now I want to install Wordpress in a the subdirectory /blog. Wordpress of course has its own rewrite statements in the .htacess file that rewrites urls differently for the blog.

How can I tell the root .htaccess file to skip over the /blog/ directory and allow the local .htaccess mod-rewrite to still work when browsing int the blog directory.

2

2 Answers

1
votes

You just do a negation in your first htaccess like

RewriteCond %{REQUEST_FILENAME} !^/blog/.*$

this should do it - hopefully! as a precondition of the rules

0
votes

Use this code in your .htaccess under DOCUMENT_ROOT:

RewriteRule ^blog/ - [L]

RewriteRule ^/([^/]*)/([^/]*)/$ index.php?page=$1&var1=$2 [L,QSA]
RewriteRule ^/([^/]*)/$ index.php?page=$1 [L,QSA]