操作均对主文件:httpd.conf进行
1.在Include conf.modules.d/*.conf 后面加
Include conf.modules.d/*.conf
LoadModule rewrite_module modules/mod_rewrite.so
2.将AllowOverride 改为all
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all
#AllowOverride None
3.在结尾加
<VirtualHost *:80>
ServerAdmin 156060944@qq.com
DocumentRoot "/var/www/17lottery/public"
ServerName lot.9xzb.com
DirectoryIndex index.php index.html index.htm
ErrorLog "logs/lot_9xzb-error_log"
CustomLog "logs/lot_9xzb-access_log" common
</VirtualHost>
4.重启Apache systemctl restart httpd 或 service httpd restart 都行