【问题标题】:does Using clean URL's with query strings change the path/directory使用带有查询字符串的干净 URL 是否会更改路径/目录
【发布时间】:2014-05-01 00:24:20
【问题描述】:

当我使用 .htaccess 和 mod_rewrite 用查询字符串重定向我的 url 时,

例如:http://www.mysite.com/index.php?group=A&id=23

到这样的网址:http://www.mysite.com/index/A/23

这是否会更改我服务器上的路径,用于链接到 .css 和 .js 文件?


因此,当我在与 index.php 相同的文件夹中有 ma​​in.css 时,我是否必须将此文件的链接更改为: <link href="../../main.css" rel="stylesheet" type="text/css">

或者我可以继续这样做吗: <link href="main.css" rel="stylesheet" type="text/css">

【问题讨论】:

  • 似乎你可以自己测试一下

标签: php .htaccess mod-rewrite redirect query-string


【解决方案1】:

是的,这会改变浏览器发送的路径。浏览器根本不知道你的mod_rewrite 规则。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-30
    • 2012-08-26
    • 1970-01-01
    • 2014-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-14
    相关资源
    最近更新 更多