標籤:
聲明:佈建網域名需要用到 httpd.conf httpd_vhosts.conf (apache) 中兩個檔案 和 hosts (C:\Windows\System32\drivers\etc)
****** 一 LoadModule rewrite_module modules/mod_rewrite.so 二 Include conf/extra/httpd-vhosts.conf ******
一 是開啟重寫地址模組 二 是開啟引用httpd-vhosts.conf檔案
如不想把程式放在htdoc檔案夾下,須設定apache\conf\httpd.conf檔案,修改DocumentRoot路徑與Directory路徑的值,並保持一致。假設要將CI架構放在F盤CI目錄下
DocumentRoot "F:\CI"<Directory "F:\CI">
在CI目錄下建立檔案夾test。下載CodeIgniter_2.1.0,將CodeIgniter_2.1.0檔案夾裡的application、system、index.php、license.txt複製到xhdoctor_server目錄下。
修改apache\conf\extra\httpd-vhosts.conf檔案,添加以下代碼。
<VirtualHost *:80>
DocumentRoot "f:/CI/xhdoctor_server/index"
ServerName xhdoctor.ci.com
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
修改C:\Windows\System32\drivers\etc\hosts檔案
127.0.0.1 xhdoctor.ci.com
修改F:\CI\xhdoctor\application\config\config.php檔案,
$config[‘base_url‘] = ‘http://xhdoctor.ci.com/‘;
apache php 配置 CI 架構