0

我正在一个 .htaccess 文件中工作,我已经成功完成了几次重定向。我遇到问题的行是:

RedirectMatch 301 ^bookfox/(.*)/(.*)/(.*) http://www.thejohnfox.com/$3

我正在尝试获取此 URL:http://thejohnfox.com/bookfox/2006/10/joyce_carol_oat
并将其转发到http://thejohnfox.com/joyce_carol_oat

我只能让 RedirectMatch 做到这一点:http://thejohnfox.comjoyce_carol_oat 我已经尝试了所有我能找到的东西,但没有任何效果。

有谁知道为什么正斜杠在之后被取出thejohnfox.com

这是我的 Wordpress .htaccess 文件中的完整代码:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Redirect 301 /bookfox/bio.html http://thejohnfox.com/bio/
Redirect 301 /bookfox/journals-accepting-novellas.html http://thejohnfox.com/journals-accepting-novellas/
Redirect 301 /bookfox/ranking-of-literary-journ.html  http://thejohnfox.com/ranking-of-literary-journals/
Redirect 301 /bookfox/what-is-bookfox.html http://thejohnfox.com/what-is-bookfox/
Redirect 301 /bookfox/journals-accepting-electronic-submissions.html http://thejohnfox.com/journals-accepting-electronic-submissions/

RedirectMatch 301 ^(.*)\.html$ http://thejohnfox.com$1/
RedirectMatch 301 ^bookfox/(.*)/(.*)/(.*) http://www.thejohnfox.com/$3

</IfModule>

# END WordPress
4

0 回答 0