<VirtualHost *:80>
ServerName 域名
ServerAlias 域名別名
DocumentRoot D:/program_code/php/xxxxxx/public
<Directory "D:/program_code/php/xxxxxx/public">
AllowOverride All
Options All
</Directory>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^.*(/.css|/.js|/.gif|/.png|/.jpg|/.jpeg)$
RewriteRule ^(/.*)$ /index.php
</VirtualHost>
/windows/system32/dirvers/etc/hosts 文件添加:
127.0.0.1 域名
--------------------------------------------普通虛擬目錄設置-----------------------------------------
<Directory "D:/testSpace/my/">
AllowOverride All
Allow from all
Options Indexes FollowSymLinks
</Directory>
其中 Indexes FollowSymLinks 如果沒有索引文件比如:index.html,index.php,index.htm的話,會顯示整個目錄下的所有內容