我试图让mod_rewrite在localhost上工作。如果我去localhost /网站,它会加载
DirectoryIndex home.php
和
localhost/website/home
也有效
但是对于每个其他页面,它只显示主页。
RewriteEngine On
RewriteBase /
RewriteRule ^home/?$ home.php [NC,L]
RewriteRule ^about/?$ about.php [NC,L] <--- this goes to home
http.cfg:
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs/website"
<Directory "C:/xampp/htdocs/website">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>