2016-11-17 115 views
0

我一直遇到我的.htaccess文件有问题。下面你可以看到什么,我试图做RewriteEngine导致错误500

  • 重定向所有入站流量,以http://hyperthunder.net/
  • 禁止观看.htaccess文件
  • 禁用清单目录
  • 自定义错误页

的域名我拥有这个虚拟主机

  • hyperthunder.net
  • hyperthunder.com

现在终于我的.htaccess文件

// 
//Domains 
//hyperthunder.net 
//hyperthunder.com 
//Both domains are on the same webhosting 
// 

// 
//Redirect 
// http://www.hyperthunder.net/ ---> http://hyperthunder.net/ 
// http://hyperthunder.com/ ---> http://hyperthunder.net/ 
// http://www.hyperthunder.com,/ ---> http://hyperthunder.net/ 
// 
Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^www.hyperthunder.net[nc] 
RewriteCond %{HTTP_HOST} ^hyperthunder.com[nc] 
RewriteCond %{HTTP_HOST} ^www.hyperthunder.com 
RewriteRule ^(.*)$ http://hyperthunder.net/$1 [r=301,nc] 

// 
//Custom Errors 
// 
ErrorDocument 400 /customerrors/400.html 
ErrorDocument 401 /customerrors/401.html 
ErrorDocument 403 /customerrors/403.html 
ErrorDocument 404 /customerrors/404.html 
ErrorDocument 500 /customerrors/500.html 

// 
//Prevent viewing of .htaccess file 
// 
<Files .htaccess> 
order allow,deny 
deny from all 
</Files> 

// 
//Prevent Directory listing 
// 
Options All -Indexes 

我无法弄清楚什么是错的。我可以查看主页,但如果我尝试hyperthunder.net/index.html,它将返回错误500即使.com域。

+0

更新: 我觉得我的虚拟主机提供商刚刚更新的网页现在显示500错误以及 –

+0

'无效的命令“//”'。以散列字符“#”开头的行被视为注释。 –

+0

解决了我自己的问题 http://stackoverflow.com/questions/17365397/redirect-multiple-domains-to-one-domain-with-or-without-www-before –

回答