php的各類配置

問題:
一、若是去掉URL_MODEL=1時的index.php
第一步:把Apache配置文件中的LoadModule rewrite_module modules/mod_rewrite.so 取消註釋
第二步:在和index.php的根目錄添加.htaccess文件 並寫入 php

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

第三步:重啓Apacheit


問題
二、如何把localhost變成自定義的域名如:tp.com
第一步:把Apache配置文件中的Include conf/extra/httpd-vhosts.conf 取消註釋
第二步:在Apache配置文件中conf/extra/httpd-vhosts.conf加入
<VirtualHost *:端口80>
DocumentRoot "你的項目的絕對路徑F:\wamp\www"
ServerName tp.com(你自定義的域名)
</VirtualHost>
第三步:在C:\WINDOWS\system32\drivers\etc\hosts文件中加入
127.0.0.1 tp.commodule

第四步:重啓Apache配置

相關文章
相關標籤/搜索