主要处理以下 的情况:

1
2
domain.com/v1  对应 /dir1/index.php
domain.com/v2 对应 /dir2/index.php

同一域名下对应不同的目录。


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<VirtualHost *:80>
ServerAdmin webmaster@lara.loc
DocumentRoot "E:\xampp\htdocs\old-proj\api"
ServerName api.example.com
ServerAlias api.example.com
SSLEngine on
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"

Alias /v3 E:\xampp\htdocs\old-proj\api_v3
#AliasMatch ^.*$ "E:\xampp\htdocs\old-proj\api_v3\index.php"
<Directory "E:\xampp\htdocs\old-proj\api_v3">
DirectoryIndex index.php
AllowOverride All
#Order allow,deny
Allow from all
</Directory>
</VirtualHost>