apache - htaccess rule - relative files -
it's easy thing fix tried google stuff i'm not sure how put in words couldn't find me.
i have problem simple .htaccess changes url supposed resources trying loaded wrong place.
my url:
http://domain.com/index.html?sport=test my re-written url:
http://domain.com/test/ .htaccess:
rewriteengine on rewriterule ^([^/]*)/$ /index.html?sport=$1 [l] now when type in: http://domain.com/test/ loads correct index file every resource file trying downloaded test folder...
this example resource file location (relative index.html):
css/styles.css js/main.js but it's looking them in:
test/css/styles.css test/js/main.js cheers
you've hit common problem people face when switching pretty url schemes. solution simple, use absolute path in css, js, images files rather relative one. means have make sure path of these files start either http:// or slash /.
or can try adding in page's html header:
<base href="/" />
Comments
Post a Comment