由于htaccess规则导致的内部服务器错误

时间:2015-10-28 11:59:57

标签: apache .htaccess mod-rewrite redirect http-status-code-301

我有这个.htaccess规则,我真的不知道这意味着什么,我从互联网上抓了它并根据我的需要改变了它但它不起作用并导致内部服务器错误。当我从.htaccess文件中删除此规则时,没有内部服务器错误。

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^outsourcelocally.com/about-us-2$ [OR]
  RewriteCond %{HTTP_HOST} ^www.outsourcelocally.com/about-us-2$
  RewriteRule (.*)$ http://www.olocally.com/about$1 [R=301,L]
</IfModule>

1 个答案:

答案 0 :(得分:0)

HTTP_HOST不包含请求网址。

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^(www\.)?outsourcelocally\.com$
  RewriteRule ^about-us-2$ http://www.olocally.com/about [R=301,L]
</IfModule>
相关问题