This question already has an answer here:
What I am trying to do:
/product.php?id=12345
into /product/awesome-product-name
What I already achieved:
/product/awesome-product-name
is now a working linkMy problem is that I cant load any resources because of the subdir products
. What I need is an easy way to change the paths to images, css and javascript files.
Current .htaccess:
RewriteEngine on
RewriteRule ^produkt/(.*)$ ./product.php?url=$1
RewriteRule 404 404.html
I dont think my question is a duplicate cause my shop files are in a sub-directory of the main webserver. So I cant access my css and js files just by putting a /
in the href, like it was the answer in one of the given duplicates
.
My solution is adding the RewriteRule RewriteRule ^produkte/(css|js|img)/(.*)?$ /shop/$1/$2 [L,QSA,R=301]
to my .htaccess
file.
</div>