LLLLLLL Posted November 13, 2011 Share Posted November 13, 2011 So I have a website that that includes resources in the header, for example: css/styles.css js/someJavaScript.js js/AnotherJavaScript.js Everything works fine; let's say the url is example.com/store/something.php. Using .htaccess, I'd like to redirect a virtual URL, say, example.com/ABCD to example.com/store/something.php. The redirection works fine (it's a virtual redirection; keeping example.com/ABCD in the address bar just like Wikipedia does, for example) but none of the resources display because it is ultimately looking for something relative to the virtual directory. Is there a way to make the resources -- and I guess images and hrefs on the pages, if possible -- always link using the original path? Obviously I could hard-code all URLs, but I'm wondering if there is a simpler, more elegant solution. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/251079-linked-resources-dont-work-with-htaccess-virtual-redirects-need-elegant-sltn/ Share on other sites More sharing options...
LLLLLLL Posted November 14, 2011 Author Share Posted November 14, 2011 This is a client issue, not a server issue. Please move this to the correct forum I think I found the answer, the "base" tag: http://www.w3schools.com/tags/tag_base.asp Because of that answer, marking as fixed. But this is in the wrong forum. Quote Link to comment https://forums.phpfreaks.com/topic/251079-linked-resources-dont-work-with-htaccess-virtual-redirects-need-elegant-sltn/#findComment-1287960 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.