我在将重写规则从迁移.htaccess
到VirtualHost
.
当我在目录之外使用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>
提前致谢。