【发布时间】:2014-10-01 08:27:17
【问题描述】:
我正在尝试在新 Mac 上设置本地开发环境。这是我的第一个,我不太确定不同的东西。
我已经正确设置了大部分内容,现在我可以像这样访问我的网站:
localhost/~carlo/website.com/
对于 Codeigniter,我必须将 index.php 放在最后。
我平时使用的.htaccess是这样的:
RewriteEngine on
RewriteBase /~carlo/website.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|cache|captcha|fonts|forum|media|img|min|css|js|scripts|images|uploads|docs|robots. txt|sitemap.xml|sitemap|public|tools|wpblog|assets|xd_receiver.htm)
RewriteRule ^(.*)$ index.php/$1 [L]
但这还不够。
我将此添加到 /private/etc/apache2/extra/httpd-vhosts.conf:
DocumentRoot "/Users/carlo/public_html" ServerName "localhost" ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log" CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
DocumentRoot "/Users/carlo/public_html/website.com" ServerName tobecontinuedcomic.com AllowOverride All Options +FollowSymLinks Order allow,deny Allow from All
但还是一无所获。有什么帮助吗?
【问题讨论】:
标签: php macos apache .htaccess codeigniter