开发者

Legacy links rewrite

I need to rewrite:

index.php?node=[something]

to

/node/[something]

(the "node" part will be static text and it's not important)

i've tr开发者_运维问答ied:

RewriteRule ^index\.php?node=(.*)$ /node/$1 [L,R=301] 

(again the rewritten "node" part will be static text and it's not important)

and a lot of other variations without success...

Thanks!


You need to use a RewriteCond to examine the query as it’s not part of the URL path:

RewriteCond %{QUERY_STRING} ^(([^&]*&+)*)node=([^&]*)(&.*)?
RewriteRule ^index\.php$ /node/%3?%1%4 [L,R=301]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜