简体   繁体   中英

mod_rewrite and htaccess

I have set up a few rules based on other questions but now my css breaks

I did have the URL /

/eshop/cart.php?products_id=bla 

and everything work fine. but now with my mod rewrite url-

/product/product-title/ 

It loose the base directory. Is there an option to fix this? So i dont have to go back with the full url in all the img src tags and so on?

Yes, I ran into this also when I started using rewritten paths. You can define the base directory in the code or just use absolute paths.

always use absolute path when link to the server resources
web-server's absolute path always starts from the /
So /css/style.css will never fail (it must be the real path of course)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM