First time using RewriteRule, so I made
RewriteRule ^details/(.*)/(.*)$ /details.php?id=$1&name=$2 [NC]
but there are some problems for images, js, etc. For example the images doesn’t work. And when I try to find the path details/3367/images/coins-icon.png
Is there a way to fix it?
I tried
RewriteRule ^details/(.*)/images/(.*)$ /images/$1
but that seems not to work.
Exclude existing files and directories from rewriting:
Furthermore you should use
<base href>or absolute url’s (starting with a forward slash/) to prevent the browser from accessing the image files based on the relative url.So when you’re viewing the page
/details/456/and there’s an imageimages/456/foo.jpgon the page, the browser will search for/details/456/images/456/foo.jpg. To prevent this, use either<base href>or absolute url’s (/images/456/foo.jpg).