【问题标题】:How to rewrite url with double directory names using htaccess?如何使用 htaccess 用双目录名重写 url?
【发布时间】:2015-05-08 10:20:37
【问题描述】:

我很难重写以下网址:

http://example-url.com/example-url.com/anythinggoeshere

到:

http://example-url.com/anythinggoeshere

我试过了:

RedirectMatch 301 example-url.com/example-url.com(.*) example-url.com$1 

但它什么也没做......

非常感谢您的帮助!

【问题讨论】:

  • 我试过这个例如:RedirectMatch 301 example-url.com/example-url.com(.*) example-url.com$1
  • 网址中有双点..typo?
  • 是的错字,我改了,不过在真正的 htaccess 中没有错字...
  • 将此代码发布到您的问题中,而不是在评论区。
  • /example-url.com 是网络目录吗?

标签: .htaccess url rewrite


【解决方案1】:

我通过执行以下操作解决了我的问题:

Redirect 301 /example-url.com http://example-url.com

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-14
    • 2011-06-17
    • 1970-01-01
    • 2021-12-23
    • 1970-01-01
    • 2012-02-07
    • 2020-04-09
    相关资源
    最近更新 更多