如何重定向此网址:
http://www.indianastro.co.il/index.php?id=moon
对此:
http://www.indianastro.co.il/?p=217
通过 .htaccess
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
...