rewrite

开启Apache的 rewrite模块

在httpd.conf目录下

#启用rewrite功能

LoadModule rewrite_module modules/mod_rewrite.so

AllowOverride None 改成 All

  1. 配置虚拟主机

appserve

wamp

如果的开发环境是自定义安装:

在httpd.conf文件中

# Virtual hosts 启动虚拟主机的配置

Include conf/extra/httpd-vhosts.conf

在httpd-vhosts.conf中

#配置我们自己的虚拟主机

<VirtualHost *:80>

    DocumentRoot "C:/myenv/apache/htdocs/hspzf/public"

    ServerName  myzf.com

    DirectoryIndex index.php  

    <Directory />

    Options FollowSymLinks

    AllowOverride None

    Order allow,deny

    Allow from all

    </Directory>

</VirtualHost>

在hosts中添加dns

  1. 重新启动 apache
原文地址:https://www.cnblogs.com/fenle/p/4388687.html