【问题标题】:301 Redirect in .htacess file produces 500 error page.htaccess 文件中的 301 重定向产生 500 错误页面
【发布时间】:2014-09-21 00:02:07
【问题描述】:

我正在尝试让我在 Wordpress 中的 301 重定向工作。我在以前的 Wordpress 网站上没有任何问题。这是我当前在检查主网站时产生 500 错误页面的内容,而不仅仅是重定向。

感谢您的帮助!

# 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]
</IfModule>

# END WordPress

Redirect 301 /images/kids%20menu.pdf http://ww2.landonwinery.com/bistro/bistro-kids-menu/
Redirect 301 /images/landon%20dinner.pdf http://ww2.landonwinery.com/bistro/bistro-dinner-menu/
Redirect 301 /images/landon%20dinner%202014.pdf http://ww2.landonwinery.com/bistro/bistro-dinner-menu/
Redirect 301 /images/landon%20lunch%202014.pdf http://ww2.landonwinery.com/bistro/bistro-lunch-menu/

【问题讨论】:

  • 尝试将 Redirect 301 移动到 rewriteBase 行的正下方。
  • 我试过了,但它仍然给我整个网站的 500 错误

标签: php wordpress redirect


【解决方案1】:

尝试将整个 Rediret 301 规则更改为

RewriteRule ^/thefile.html$ /yourdirectory/thefile.html [R=301,L]

查看here 以进一步结帐..

【讨论】:

  • 不确定是否需要编辑您给我的内容或只是将其粘贴进去。我对 htacess 编辑不是很熟悉。这就是我文件中的内容。 (这也包括一些其他插件信息和所有重定向)ww2.landonwinery.com/wp-content/Redirects%202.txt
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-16
  • 1970-01-01
  • 2012-03-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多