与路线和mod-rewrite(如果没有绝对的我不明白的CSS,JS或图像)问题 [英] Problem with routes and mod-rewrite (if not absolute i don't get CSS, JS or images)
问题描述
我更新了code从我的网站到一个'好'veersion我认为,
i updated the code from my website to a 'better' veersion i think,
它工作正常,但是当我试图实现友好的URL并加载它,工作原理,但没有CSS,Javascript或图片, 但如果我corret的CSS的路线 HTTP://website/css/style.css (而不是我做的./css/style.css)就看到了CSS的正确加载,
it works fine but when i try to implement the friendly URL and load it, works, but with no CSS, Javascript or images, but if i corret the routes for the css to http://website/css/style.css (instead of ./css/style.css) it i do see the CSS properly loaded,
任何想法,为什么?
例: http://keepyourlinks.com/link1.php?id=25 VS http://keepyourlinks.com/keep/25/series-yonkis
(我更新了CSS的路线,但JavaScript是缺少一个图像asweell)
(i updated the route of the CSS, but the Javascript is missing an the images asweell)
我真的想不会有纠正人的路线:(
I really would like not to have to correct al routes :(
推荐答案
./
表示当前目录,这是不是哪里的文件,所以它不科技工作。
./
means the current directory, which isn't where the file is, so it doesn't work.
您最好的选择是开始使用相对于你的网站的根目录,从现在开始的路径,每次你写一个链接样式表或JavaScript或图像,在每一个网站。它总是工作,并节省您这样的问题。
Your best bet is to start using paths relative to the root of your site from now on, every time you write a link to a stylesheet or javascript or image, on every site. It always works and saves you from problems like this.
/css/style.css
指向相同的URL,无论当前页面是在哪个目录。
/css/style.css
points to the same URL no matter what directory the current page is in.
这篇关于与路线和mod-rewrite(如果没有绝对的我不明白的CSS,JS或图像)问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!