Rajib Deb
Rajib Deb

Reputation: 51

htaccess rewrite url with parameters not showing images

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

Answers (2)

Rajib Deb
Rajib Deb

Reputation: 51

Finally I am able to run it using,

<base href="/" /> 

Upvotes: 0

Skamielina
Skamielina

Reputation: 802

You can use RewriteCond before RewriteRule statement

RewriteCond %{REQUEST_URI} !\.(jpg|png|css)$ [NC]

Upvotes: 2

Related Questions