尝试使用codeigniter和mamp在本地使用子域

时间:2011-12-27 17:33:09

标签: apache codeigniter subdomain mamp

我正在尝试关注此问题http://net.tutsplus.com/tutorials/php/basecamp-style-subdomains-with-codeigniter/以使子域名在本地运行。

我已将此添加到/ etc / hosts文件

127.0.0.1       snapgiftapp.com
127.0.0.1       test1.snapgiftapp.com
127.0.0.1       test2.snapgiftapp.com

我已将此添加到/Applications/MAMP/conf/apache/httpd.config文件的末尾

<VirtualHost *:80>  
    DocumentRoot "/Users/tomcaflisch/Sites/snapGiftAppFront"  
    ServerName snapgiftapp.com  
    ServerAlias snapgiftapp.com  

    <Directory "/Users/tomcaflisch/Sites/snapGiftAppFront">  
        Options -Indexes  
        Options FollowSymLinks  
        AllowOverride All  
    </Directory>  
</VirtualHost>  

<VirtualHost *:80>  
    DocumentRoot "/Users/tomcaflisch/Sites/snapGiftApp"  
    ServerName snapgiftapp.com  
    ServerAlias *.snapgiftapp.com  

    <Directory "/Users/tomcaflisch/Sites/snapGiftApp">  
        Options -Indexes  
        Options FollowSymLinks  
        AllowOverride All  
    </Directory>  
</VirtualHost>

当我将浏览器指向snapgiftapp.com或test1.snapgiftapp.com时,我获得了位于snapGiftAppFront文件夹中的同一站点

1 个答案:

答案 0 :(得分:0)

我必须进入mamp配置并将端口更改为80而不是8888。