搜索引擎友好的网址CSS IMG JS不工作 [英] Seo Friendly Url css img js not working
问题描述
我想让我的URL作为搜索引擎友好的URL。我试图重写规则编辑.htaccess文件
I want to make my URL as SEO Friendly URL. I tried editing .htaccess file by rewriting rule
RewriteRule ^swift-details/([0-9]+)/([0-9a-zA-Z_-]+)$ swift-details.php?id=$1 [NC,L]
RewriteRule ^swift-details/(css|js|img)/(.*)?$ /$1/$2 [L,QSA,R=301]
它的路由正确的URL,但在该页面的CSS JS和图像不工作。
It's routing the correct URL but in that page CSS JS and images are not working.
例如网址:
http://www.bankhints.com/swift-details/2/abblinbb
推荐答案
您不需要第二个重写规则。你的CSS / JS路径都是相对到你的当前位置。
You dont need the second rewrite rule. Your CSS/JS paths are all 'relative' to your current location.
您的CSS存在的位置: /css/normalize.css
Your CSS exists here: /css/normalize.css
您的网页正在这里: /swift-details/2/abblinbb/css/normalize.css
Your page is looking here: /swift-details/2/abblinbb/css/normalize.css
所有你需要你的CSS / JS路径之前是'向前斜杠'。
All you need is 'forward-slashes' before your CSS/JS paths.
这篇关于搜索引擎友好的网址CSS IMG JS不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!