<VirtualHost *:80>
ServerName abc.example.com
ServerAlias abc.example.com
DocumentRoot /var/www/html/abc
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteCond %{REQUEST_URI} !^/adl/$
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html
</VirtualHost>
alias /adl /opt/dl
我有一个像这样的虚拟主机设置,并且运行良好。现在,我想在路径中是否存在不应该应用重写规则的 / adl ,并且我有一个别名指向我的计算机目录结构中的路径。
答案 0 :(得分:0)
我已经按照下面的方式修复了它
<VirtualHost *:80>
ServerName walton2.biz-motion.com
ServerAlias walton2.biz-motion.com
DocumentRoot /var/www/html/fmcg
RewriteEngine On
RewriteRule ^/?(adl)($|/) - [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
RewriteRule ^ /index.html
</VirtualHost>
将其发布,因为任何人都可能遇到此问题。