Reputation: 51
I am trying to rewrite urls using htaccess.
I want similar url, www.mydomain.com/region/category/product/
It will go to page, www.mydomain.com/index.php?reg=region&cat=category&prod=product
I am using the below code in htaccess,
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/?$ index.php?reg=$1&cat=$2&prod=$3 [L]
Though I am able to access the parameters in index.php, but browsers are unable to load images, css etc, htaccess also rewriting urls for them.
Please help me to solve this issue.
Thanks in Advance!
Upvotes: 1
Views: 304
Reputation: 802
You can use RewriteCond before RewriteRule statement
RewriteCond %{REQUEST_URI} !\.(jpg|png|css)$ [NC]
Upvotes: 2