.htaccess重写而不影响相对图像/css/js URL?
我需要一些关于我的htaccess文件的简单帮助,提前谢谢你 我有许多网站URL,例如:.htaccess重写而不影响相对图像/css/js URL?,.htaccess,mod-rewrite,rewrite,relative-url,.htaccess,Mod Rewrite,Rewrite,Relative Url,我需要一些关于我的htaccess文件的简单帮助,提前谢谢你 我有许多网站URL,例如: www.site.com/index.php?page_path=solutions-overview.html www.site.com/index.php?page_path=solutions-a.html 我想使用重写引擎将上述链接分别更改为以下内容: www.site.com/solutions/overview www.site.com/solutions/a 下面是我正在使用的.hta
- www.site.com/index.php?page_path=solutions-overview.html
- www.site.com/index.php?page_path=solutions-a.html
- www.site.com/solutions/overview
- www.site.com/solutions/a
RewriteEngine On
RewriteRule ^solutions/overview index.php?page_path=solutions-overview.html
RewriteRule ^solutions/a index.php?page_path=solutions-a.html
这是可行的,但是我的所有图像、CSS文件和JS文件不再加载,因为页面试图获取错误的URL。例如“/images/blah.jpg”作为“/solutions/images/blah.jpg”加载
如何修改htaccess代码以防止相对URL发生更改
谢谢大家! 将这一行
添加到
标记内的页面中,如下所示:
<head>
<title>Your site title</title>
<BASE href="http://www.yoursitename.com/">
....
</head>
你的网站标题
....
将这一行
添加到
标记内的页面中,如下所示:
<head>
<title>Your site title</title>
<BASE href="http://www.yoursitename.com/">
....
</head>
你的网站标题
....
in的可能重复是这方面的常规模式…谢谢,但这没有帮助。我找不到使用htaccess的解决方案。对于任何感兴趣的人-我通过将以下内容添加到我的HTML
的标题中解决了这个问题,这样相对URL总是从中解析出来,这是一般模式中可能的重复项…谢谢,但这没有帮助。我找不到使用htaccess的解决方案。对于任何感兴趣的人-我通过将以下内容添加到我的HTML
的标题中解决了这个问题,这样相对URL总是从此标题解析