0

I have a rewrite rule currently as shown below:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^([^/]+)/([^/]+)$ $2.php?locale=$1 [QSA,L]
RewriteRule ^([^/]+)/([^/]+)/([^/]+) $2.php?page=$3&locale=$1 [QSA,L]

My page URLs are like this:

http://example.com/en/new

or this:

http://example.com/en/new/1

As for the index page it's like this:

http://example.com/en/index

and I wanna get rid of the 'index' word so I added this rule:

RewriteRule ^(.*)$ index\.php/$1 [L]

Which works as expected except for my web assets (css, js files) which are located under: /css and /js folders now has 500 error. So my question is how to I exclude URLs pointing to these files under these 2 directories from being rewritten.

Andy Chuo
  • 127
  • 2
  • 9

1 Answers1

0

This solved my problem. Either use the suggested answer from here

http://stackoverflow.com/questions/1848500/htaccess-mod-rewrite-how-to-exclude-directory-from-rewrite-rule?rq=1

or simply create a .htaccess file inside the directory where you don't want rewriting to take place and put this in:

RewriteEngine Off
Andy Chuo
  • 127
  • 2
  • 9