如何修改网站根目录?
也许你希望将网站根目录设置到D盘或不喜欢现在根目录的位置,这个时候就需要修改网站默认根目录了。WAMP环境的根目录是可以被修改的,具体只需2个步骤:
打开phpStudy->其他选项菜单->打开配置文件->vhosts-ini
将配置文件中C:\websoft9\phpStudy\PHPTutorial\WWW的路径改成你的路径(例如:D:\wwwroot)
<VirtualHost _default_:80> DocumentRoot "C:\websoft9\phpStudy\PHPTutorial\WWW" <Directory "C:\websoft9\phpStudy\PHPTutorial\WWW"> Options -Indexes -FollowSymLinks +ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "C:\websoft9\phpStudy\PHPTutorial\WWW\9panel" ServerName www.example.com ServerAlias example.com <Directory "C:\websoft9\phpStudy\PHPTutorial\WWW\9panel"> Options FollowSymLinks ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost>
将原来WWW文件夹的phpmyadmin,9panel文件夹拷贝到自定义的目录
phpStudy->服务管理器->重启全部