感谢您阅读本文!
我正在建立的网站用于2003年以来举行的年度研讨会。所有这些网站仍然在线,应该保持在线。
从2003年到2012年,网站没有使用任何cms,可以通过/$year子目录访问。(见以下结构)
自2012年起,子目录从wolfCMS中生成。从今年起,我们希望切换到wordpress。(见以下结构)
应如何配置htaccess文件以使其工作,以便用户从研讨会的早期版本重定向到wolfcms,并从今年起重定向到wordpress站点?谢谢
网站结构:
htaccess of wolfCMS in ~/public\\u html/文件夹:
#Setting Wolf CMS requirements
#On some server configurations you may need to comment out one or more of
#the three lines below due to server limitations.
php_flag magic_quotes_gpc off
AddDefaultCharset UTF-8
Options -Indexes +FollowSymLinks
# Setting rewrite rules
<IfModule mod_rewrite.c>
RewriteEngine On
# Set next line to your Wolf CMS root - if not in subdir, then just /
RewriteBase /
RewriteCond %{http_host} !^www.root.nl [NC]
RewriteRule ^(.*)$ http://www.root.nl/$1 [L,R=301]
# Rules to allow install sequence to test for mod_rewrite support
RewriteRule ^wolf/install/index.html$ wolf/install/index.php?rewrite=1 [L,QSA]
RewriteRule ^wolf/install/index.php$ wolf/install/index.php?rewrite=1 [L,QSA]
RewriteRule ^wolf/install/$ wolf/install/index.php?rewrite=1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
# Main URL rewriting.
RewriteRule ^(.*)$ index.php?WOLFPAGE=$1 [L,QSA]
</IfModule>
htaccess of wordpress in ~/public\\u html/wordpress/文件夹:
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{HTTP_HOST} root.nl/wordpress/$1 [NC]
RewriteRule ^(.*)$ http://root.nl/$1 [R=301,L]
#RewriteRule ^index\\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\\.php)$ $2 [L]
# RewriteRule . /wordpress/index.php [L]