适用于 CI、TP等php框架
请求地址
原来访问地址是http://127.0.0.1/diy.php/
配置以后是http://127.0.0.1:888
Apache配置信息
Listen 888
<VirtualHost *:888>
DocumentRoot "/home/wwwroot/yourdomain"
DirectoryIndex diy.php
#解决跨域资源访问
# Header set Access-Control-Allow-Origin "*"
<Directory "/home/wwwroot/yourdomain">
Options +Indexes +Includes +FollowSymLinks
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
RewriteEngine on
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ /diy.php/$1 [L]
</VirtualHost>
修改Listen 888
监听端口888即可完成同个目录多个端口访问,或者多站点访问