第一种方法:直接修改配置文件
![](https://i-blog.csdnimg.cn/blog_migrate/f9c4ae5fcb82e186492ea4fd8cf9fcd5.jpeg)
第二种方法:
第一步:配置Apache的httpd-vhosts.conf文件
<VirtuaHost *:80>
...
<Directory ...>
allowoverride all
//表示引用.htaccess文件
</Directory>
</VirtuaHost>
第二步:创建.htaccess文件,将规则写在该文件中
Allow from all
Options FollowSymLinks
DirectoryIndex abc.html abc.php
errorDocument 404 /404.html
<IfModule rewrite_module>
RewriteEngine On
RewriteRule ...
</IfModule>