0

如何重定向此网址:

http://www.indianastro.co.il/index.php?id=moon

对此:

http://www.indianastro.co.il/?p=217

通过 .htaccess

4

1 回答 1

1

moon如果两个标识符( => )之间没有关系,217您可以使用RewriteMap。基于文档中的示例:

RewriteMap oldsite2wordpress txt:/etc/apache2/oldsite2wordpress.txt
RewriteRule ^index.php?id=(.*) /?p=${oldsite2wordpress:$1|NOTFOUND} [PT]

然后你定义映射/etc/apache2/oldsite2wordpress.txt

##
## oldsite2wordpress.txt - Maps old website IDs to WordPress IDs
##

moon 217
earth 87
sun 997
...
于 2012-06-10T05:49:36.863 回答