doulongdan2264 2014-10-10 08:31
浏览 46
已采纳

从子目录重定向HTACCESS

i am Working on a redirect script

i want to redirect all links contaning /en/

For eg redirect link like this

http://example.com/en/some-text/123-some-text-123456.html

to

http://example.com/some-text/123-some-text-123456.html

I am trying with this script but not workin as of now

RewriteEngine on
RewriteCond %{HTTP_HOST} (.*)\en\(.*)
RewriteRule http://www.example.com/$1 [R=301,L]

Any help would be appreciated

Thanks!

  • 写回答

2条回答 默认 最新

  • douzhe9075 2014-10-10 08:35
    关注

    It is simple by using this

    Redirect 301 http://example.com/en/(.*)$ http://example.com/$1
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?