2

我在将重写规则从迁移.htaccessVirtualHost.

当我在目录之外使用VirtualHost它时,它可以工作,但是我遇到了一些身份验证错误 - 所以我想知道我应该更改它以使其在VirtualHost.

或者应该将它们添加到<Directory /var/www/server/>

规则:

<Directory /var/www/server/subfolder/>
    RewriteEngine On
    RewriteCond $1 !^(index\.php|images|js|css|robots\.txt)
    RewriteRule ^(.*)$ /subfolder/index.php/$1 [L]
</Directory>

虚拟主机:

<VirtualHost *:80>
ServerAdmin admin@server.com
Servername server.com
ServerAlias server2 server2.com server server.com

DocumentRoot /var/www/server

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory /var/www/server/>
    AuthType NTLM
    AuthName Server
    require valid-user

    PythonAuthenHandler pyntlm
    PythonOption Domain SERVER.COM
    PythonOption PDC xxx.xxx.xxx.xxx
    PythonOption BDC xxx.xxx.xxx.xxx

    Order allow,deny
    Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/server.com_error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/server.com_access.log combined env=!nolog
</VirtualHost>

提前致谢。

4

1 回答 1

0

为我解决身份验证问题的是添加

Order allow,deny
Allow from all

对现有的<Directory /var/www/server/subfolder/>.

尽管我仍然只能<Directory><VirtualHost>.

谢谢大家。

于 2013-01-07T08:21:23.447 回答