开发者

delete a level in a path URL Rewriting

开发者_如何学编程I have this url:

www.company1.com/level1/level2

I would to rewrite Url to www.company1.com/level2

Is it possible with URL-Rewriting in Apache?


This rule should do it:

RewriteRule ^[^/]+/(.*) /$1 [L,R=301]

If you don’t want to use that rule in the .htaccess file in the document root directory but in the server or virtual host configuration, precede the pattern with a /:

RewriteRule ^/[^/]+/(.*) /$1 [L,R=301]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜