如何使用htaccess的修正后的资源文件路径 [英] How to fix resource file path after using htaccess
本文介绍了如何使用htaccess的修正后的资源文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在浏览器中显示:
http://example.com/first/second
和遇到一个相对URL,例如:
and encounters a relative URL such as:
<img src="site/images/photo.png">
它把相对URL(分别):
It translates the relative URL to (respectively):
http://example.com/first/second/site/images/ photo.png
所以有什么解决办法
推荐答案
试着增加code略低于 RewriteEngine叙述在
行
Try adding the code to just below the RewriteEngine On
line
RewriteCond %{REQUEST_FILENAME} !-f
您还可以添加以下到&LT; HEAD&GT;
,这可能会擦出火花
You can also added the following to the <head>
, which might work either.
<base href="http://www.example.com/" />
这篇关于如何使用htaccess的修正后的资源文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文