将非www重定向到.htaccess中的www导致内部错误

时间:2018-03-22 10:41:56

标签: apache .htaccess

我想将任何非www调用转发给www所以我使用了来自this主题的答案,但我得到了

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

我的代码看起来像这样

AddDefaultCharSet utf-8

RewriteEngine on

RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [R=301]


RewriteRule ^team/(.*)/(.*)/$ team.php?t=$2 [L]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddType application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

有什么想法吗?

0 个答案:

没有答案