开发者

HTACCESS many directories with rewrite base, rewriterule

开发者 https://www.devze.com 2023-03-30 07:18 出处:网络
I have a serious problem which is the next : I have a directory like this : http://example.com/kl/bold2/bold3/contents/

I have a serious problem which is the next : I have a directory like this : http://example.com/kl/bold2/bold3/contents/ what I would like to do is to make is a rewrite, for example I have :

http://example.com/kl/bold2/bold3/contents/menu.php?menu=herewego

and I would like to transfer it 开发者_如何学Pythonto this :

http://example.com/herewego

So, guys how can I do this with htaccess ?

Thank you for helping !


you should put something in url that Apache can decide which rule should apply! otherwise it's impossible to rewrite URL with correct rule!
for example :http://example.com/longdir/herewego

RewriteRule ^longdir/(.*)$  kl/bold2/bold3/contents/menu.php?menu=$1
0

精彩评论

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