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域。
更新: 我覺得我的虛擬主機提供商剛剛更新的網頁現在顯示500錯誤以及 –
'無效的命令「//」'。以散列字符「#」開頭的行被視爲註釋。 –
解決了我自己的問題 http://stackoverflow.com/questions/17365397/redirect-multiple-domains-to-one-domain-with-or-without-www-before –