apache 配置虚拟目录
#注释掉apache默认的网站目录地址
#DocumentRoot "/Apache/htdocs"
#配置一个虚拟目录
<ifModule dir_module>
#设置主页
Direcotory index.html my.html
#虚拟目录地址及名字
Alias /myhome "/myhome"
#允许访问权限
<Direcotory d:/myhome>
#读取顺序 先允许后拒绝 允许所有人拒绝所有人
order allow,deny
#允许所有人(结果为允许所有人)
allow form all
<Direcotory>
<IfModule>
或者:
<VirtualHost *:80>
DocumentRoot "E:\www\sk"
ServerName e.com
ServerAlias
Alias /kouhong "E:\www\kouhong\public"
<Directory "E:\www\sk">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
Nginx:
location /web/ {
alias /home/www/html/;
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
}
更多: