Config:Apache:CodeIgniter

出自 Chan
前往: 導覽搜尋

conf

<VirtualHost *:80>
    ServerName ci.local
    ServerAdmin [email protected]
    DocumentRoot /var/www/ci/

    ErrorLog ${APACHE_LOG_DIR}/ci.local-error.log
    CustomLog ${APACHE_LOG_DIR}/ci.local-access.log combined

    <Directory "/var/www/ci">
        AllowOverride All
    </Directory>

    <FilesMatch "\.php$">
        SetHandler  "proxy:unix:/path/to/app.sock|fcgi://localhost/"
    </FilesMatch>
</VirtualHost>

.htaccess

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]