【问题标题】:Bad page display when search terms include char /搜索词包含 char / 时页面显示错误
【发布时间】:2015-11-12 08:06:00
【问题描述】:

我有一个显示搜索结果的 URL。我的 .htaccess 看起来像这样:

Options FollowSymLinks Options -Multiviews RewriteEngine On Rewriterule ^search-(.*)-(.*)-(.*)-([0-9]+)$ basic.php?token=$1&service=$2&location=$3&pageNumber=$4

servicelocation 不包含任何特殊字符时,查询会完美运行,但如果有人搜索c/ street Name 之类的内容,或者只是搜索字符串包含\(反斜杠),我的应用程序会显示搜索页面但没有样式(只有纯文本,没有按钮)。

我猜这是因为 URL 类似于 http://domain.com/search-token-lawyer-c/street%name/ 字符造成了麻烦。

我该如何解决?

提前谢谢你

【问题讨论】:

    标签: php jquery .htaccess search


    【解决方案1】:

    添加您的basic.php html 标头代码:

    <base href="/">
    

    【讨论】:

    • 现在所有搜索看起来都像没有样式的搜索页面
    • 对 css 文件使用绝对链接(或相对于 root 使用 /directory/...
    • 好的,已修复,感谢您的提示。我包括 domain.com">
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多