- vhost里面添加一条
<VirtualHost *:80>
DocumentRoot "C:\phpStudy\PHPTutorial\WWW\php\bcloud"
ServerName www._bcloud.com
ServerAlias _bcloud.com
ServerAdmin stefan321@qq.com
ErrorLog "logs\php.com-error.log"
CustomLog "logs\php.com-access.log" common
ErrorDocument 404 logs/404.html
<Directory "C:\phpStudy\PHPTutorial\WWW\php\bcloud">
Options -Indexes -FollowSymLinks +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</Directory>
</VirtualHost>
- 启用php扩展php_fileinfo,和apache的mod_rewrite功能
- 按照官方文档安装即可
Rel:
- apache的虚拟域名rewrite配置以及.htaccess的使用。
https://blog.csdn.net/zls986992484/article/details/52878482 - nginx和apache下的url rewrite
https://www.cnblogs.com/yiluxiuxing/p/4309347.html - Apache Rewrite url重定向功能的简单配置
https://www.cnblogs.com/jukan/p/5660736.html - Apache URL重写规则
https://www.cnblogs.com/phpstudy2015-6/p/6715892.html