【问题标题】:.htaccess change /es/ to .es.htaccess 将 /es/ 更改为 .es
【发布时间】:2012-11-22 08:12:58
【问题描述】:

我正在使用以下域:

http://www.domain.com/es/blabla.html

我想更改 .es 的 /es 部分并将 URLS 转换为:

http://www.domain.com.es/blabla.html

我尝试了很多可能性,但没有找到解决方案。

例如,其中之一是:

RewriteRule ^es/(.*)$ http://www.domain.com.es/$1 [L]

但它进入了一个无限循环。我试图避免添加这一行:

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]

但是服务器不允许这个调用。所以我还是有这个问题。

【问题讨论】:

    标签: .htaccess redirect rewrite


    【解决方案1】:

    检查一下。

    RewriteEngine On
    RewriteRule ^\.html$ /es/blabla.html [L]
    

    【讨论】:

    • 我试过了,它不会改变网址。无论如何,谢谢你;)
    • 我终于解决了。我放了下一个: Redirect /es/ domain.com.es 它工作正常。感谢您的宝贵时间;)
    • 不客气。 :-) @user1844333
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-23
    • 2019-06-24
    相关资源
    最近更新 更多