我的root htaccess中已经有了一些url重定向规则,所以在按照步骤给wordpress提供了自己的目录后,除了我的旧url重定向/重写不再有效之外,一切都运行良好。
老htaccess
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule dailylife/(.*)\.html dailylife.php?d=$1
新的wordpress目录
RewriteBase /news/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /news/index.php [L]
RewriteRule dailylife/(.*)\.html dailylife.php?d=$1
欢迎任何帮助
答案 0 :(得分:1)
您需要在 wordpress'路由规则之前使用旧规则:
RewriteBase /news/
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule dailylife/(.*)\.html /dailylife.php?d=$1 [L]
RewriteBase /news/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /news/index.php [L]