开发者

Mod_Rewrite assistance for a noob please

I want to rewrite all URLs of the form:

http://www.site.com/push20/dir1/dir2/afile.html

to

http://www.开发者_运维知识库site.com/dir1/dir2/afile.html

I.e. lose the push20 bit

I've tried with:

RewriteEngine On
RewriteRule ^push20/(.*) /$1 [R]

but its not happening.

Any suggestion?


Won't you need a leading / before push20?

i.e:

RewriteRule ^/push20/(.*) /$1 [R]


Unless I'm missing something, you can do this with a standard Redirect directive, something along these lines:

Redirect /push20 /

That should redirect everything under /push20 to the root of your site -- basically it strips out push20 and redirects.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜