Saleh
Saleh

Reputation: 2719

.htaccess - URL rewrite help

I have this code in my .htacess file :

RewriteEngine On
RewriteRule ^article/(\d.*) article.php?id=$1

When I open a link like this:

http://localhost/mysite/article/10

The page will open but no images, CSS, JS file loaded, I guess the problem is that pages are going to this URL article/10, so every URL in the article.php is changing to new URL even after redirect works.

How I can fix this problem?

Upvotes: 1

Views: 301

Answers (1)

Meberem
Meberem

Reputation: 947

This depends on where your resources are stored and how they are linked in your article, your article will need to point to something like http://localhost/mysite/image to reference an image without it being redirected by your script

Upvotes: 1

Related Questions