阻止访问文件夹并仅允许来自子域

时间:2015-04-01 19:40:38

标签: apache mod-rewrite webserver

我有一个名为roundcube的文件夹,还有一个名为webmail.domain.org的子域名。我在.htaccess中添加此代码以阻止访问domain.org/roundcube,并仅允许在webmail.domain.org上使用。

RewriteEngine on
RewriteCond %{HTTP_HOST} !^webmail\.domain\.org$ [NC] 
RewriteRule ^roundcube/$ http://webmail.domain.org [L,NC,R=301]`

访问domain.org/roundcube仍然有效,webmail.domain.org给了我这个错误:

Internal Server Error

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

Please contact the server administrator, me@domain.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

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

我做错了什么?

0 个答案:

没有答案