【问题标题】:Htaccess - redirect if url contains a " symbolHtaccess - 如果 url 包含 " 符号则重定向
【发布时间】:2018-01-30 16:29:03
【问题描述】:

我想在 .htaccess 中设置一个规则来重定向以下 URL:

example.com/custom-path/”jack”/

到

example.com/custom-path/jack/

简而言之,我只想删除 ” 并将 (301) 重定向到正确的 URL(没有 ” 的相同 URL)。

我应该使用什么 htaccess 规则来做到这一点?

【问题讨论】:

标签: .htaccess redirect url-redirection


【解决方案1】:

您可以在.htaccess 文件中使用以下规则:

RewriteEngine on
RewriteCond %{THE_REQUEST} /custom-path/%22jack%22 [NC]
RewriteRule ^.*$ http://exmaple.com/custom-path/jack [L,R=301]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-31
    • 2011-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-08
    • 2014-02-26
    相关资源
    最近更新 更多