我正在将我的网站从 Mediawiki 移动到 Wordpress,并希望重定向此页面:
http://wecheck.org/wiki/Aaron_Swartz
到这个页面:
http://newslines.org/wiki/category/computer-people/aaron-swartz/
目前在 .htaccess 我有
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^title=Aaron_Swartz$
RewriteRule ^/w/index\.php$ http://newslines.org/wiki/category/computer-people/aaron-swartz/? [L,R=301]
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L]
第二部分为 mediawiki 制作漂亮的 URL。我尝试了很多很多变化,但我根本无法让它工作。非常感谢任何帮助。
更新:使用给定解决方案的日志文件。.phtml 是什么?
[24/Jan/2013:22:01:00 +0000] init rewrite engine with requested uri /wiki/Aaron_Swartz
[24/Jan/2013:22:01:00 +0000] (1) pass through /wiki/Aaron_Swartz
[24/Jan/2013:22:01:00 +0000] (1) [perdir /var/www/] pass through /var/www/w/wiki.phtml
[24/Jan/2013:22:01:00 +0000] (3) [perdir /var/www/] add path info postfix: /var/www/w/wiki.phtml -> /var/www/w/wiki.phtml/Aaron_Swartz
[24/Jan/2013:22:01:00 +0000] (3) [perdir /var/www/] strip per-dir prefix: /var/www/w/wiki.phtml/Aaron_Swartz -> w/wiki.phtml/Aaron_Swartz
[24/Jan/2013:22:01:00 +0000] (3) [perdir /var/www/] applying pattern '^wiki/Aaron_Swartz$' to uri 'w/wiki.phtml/Aaron_Swartz'
[24/Jan/2013:22:01:00 +0000] (3) [perdir /var/www/] add path info postfix: /var/www/w/wiki.phtml -> /var/www/w/wiki.phtml/Aaron_Swartz
[24/Jan/2013:22:01:00 +0000] (3) [perdir /var/www/] strip per-dir prefix: /var/www/w/wiki.phtml/Aaron_Swartz -> w/wiki.phtml/Aaron_Swartz
[24/Jan/2013:22:01:00 +0000] (3) [perdir /var/www/] applying pattern '^w/index\.php$' to uri 'w/wiki.phtml/Aaron_Swartz'
[24/Jan/2013:22:01:00 +0000] (1) [perdir /var/www/] pass through /var/www/w/wiki.phtml