我将一个旧站点转移到wordpress。
问题是,网络中有一些链接来自旧页面,需要转移到新的slug。
由于我不想只为了简单的静态重定向而向站点添加更多插件,我在<;IfModule mod\\U重写。c>中的截面。htaccess
# END W3TC Browser Cache
# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* - [E=W3TC_ENC:_gzip]
RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
RewriteRule .* - [E=W3TC_PREVIEW:_preview]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =""
RewriteCond %{REQUEST_URI} \\/$
RewriteCond %{HTTP_COOKIE} !(comment_author|wp\\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
# My redirects begin here
Redirect 301 /?page=123 /team/
Redirect 301 /?page=456 /contact/
# ... ect
但是当我尝试
curl -I www.example.com/?page=123
我得到的是404而不是301。另请访问www.example。com/team/gives 200。
如何调试重定向?重定向301是否在某种程度上受到Wordpress或插件添加的RewriteCond和RewriteRule集的影响?