0

enter image description hereI used .htaccess for url rewrite.These code used.

RewriteRule  ^products/([0-9]+)/?$    search.php?srhCat=$1    [NC,L]    # Handle product requests

These rule is ok to call php file.But other css,image path is wrong. How to solve these error.

Mr Myo
  • 49
  • 3
  • 10

2 Answers2

0

Based on your URL rewrite, the path now changes to

http://localhost/superpages/products/4

It will then attempt to load your assets on:

http://localhost/superpages/products/4/js/sample.js http://localhost/superpages/products/4/css/sample.css http://localhost/superpages/products/4/images/sample.jpg

You may check your browser's debug console to check where those assets are being loaded. You may expect to see a 404 error on the said assets. You may fix this by providing the document root path preceding the asset file.

rai
  • 449
  • 3
  • 10
0

In your html if you are using relative paths for the js, images, css than their paths should begin with /:

 <img src="/<path to the image>">

If you add the html code of the page or the failed requests for css and image files it would help.

krasipenkov
  • 2,031
  • 1
  • 11
  • 13