Code: Select all
RewriteEngine on
RewriteBase /
RewriteRule !\.(php|htm|html|cgi|js|ico|gif|jpg|png|css)$ index.phpHowever, say you want to make an exception for a specific directory. Say /blog/ in which you install a blog application, which uses it's own htaccess file and rewrite rules. Then the htaccess rules above prevent that from working. Now I found out that adding this:
Code: Select all
RewriteEngine on
RewriteBase /
RewriteRule ^blog/(.*)$ blog/$1 [L]
RewriteRule !\.(php|htm|html|cgi|js|ico|gif|jpg|png|css)$ index.phpIs this the/a correct way to handle a situation like this?
(it seems to work, but I'm just wondering if there are better solutions)