Wordpress htaccess 301重定向中的特殊字符
我没有收到任何服务器错误,但我的一些重定向不起作用,只是以404结束 示例:Wordpress htaccess 301重定向中的特殊字符,wordpress,apache,.htaccess,redirect,Wordpress,Apache,.htaccess,Redirect,我没有收到任何服务器错误,但我的一些重定向不起作用,只是以404结束 示例: Redirect 301 /documents/2157622/29403025/COO%20candidate%20information%20pack /wp-content/uploads/2015/10/COO-candidate-information-pack1.pdf 我认为这可能与URL中的特殊字符有关,如%20 有没有什么方法可以让我获得.htaccess来阅读和尊重这些角色?我只需要简单的3
Redirect 301 /documents/2157622/29403025/COO%20candidate%20information%20pack /wp-content/uploads/2015/10/COO-candidate-information-pack1.pdf
我认为这可能与URL中的特殊字符有关,如%20
有没有什么方法可以让我获得.htaccess来阅读和尊重这些角色?我只需要简单的301重定向(我有数百个)
谢谢 在
.htaccess
中使用重写规则,而不是重定向
:
RewriteEngine On
RewriteRule ^documents/2157622/29403025/COO(\s|\x20)candidate(\s|\x20)information(\s|\x20)pack /wp-content/uploads/2015/10/COO-candidate-information-pack1.pdf [L,NC,R=301]
使用(\s |\x20)
匹配空白