php的各种配置

问题:
1、如果去掉URL_MODEL=1时的index.php
第一步:把Apache配置文件中的LoadModule rewrite_module modules/mod_rewrite.so 取消注释
第二步:在和index.php的根目录添加.htaccess文件 并写入

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

第三步:重启Apache


问题
2、如何把localhost变成自定义的域名如:tp.com
第一步:把Apache配置文件中的Include conf/extra/httpd-vhosts.conf 取消注释
第二步:在Apache配置文件中conf/extra/httpd-vhosts.conf加入
<VirtualHost *:端口80>
DocumentRoot "你的项目的绝对路径F:wampwww"
ServerName tp.com(你自定义的域名)
</VirtualHost>
第三步:在C:WINDOWSsystem32driversetchosts文件中加入
127.0.0.1 tp.com

第四步:重启Apache

原文地址:https://www.cnblogs.com/goesby/p/4685785.html