Mod_rewrite in Cakephp using Apache

cake folder:

<IfModule mod_rewrite.c>

    RewriteEngine on

    RewriteRule ^$ app/webroot/ [L]

    RewriteRule (.*) app/webroot/$1 [L]

</IfModule>

cake/app folder:

<IfModule mod_rewrite.c>

    RewriteEngine on

    RewriteRule    ^$    webroot/    [L]

    RewriteRule    (.*) webroot/$1    [L]

 </IfModule>

cake/app/webroot folder:

<IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

</IfModule>

The httpd.conf:

<VirtualHost 180.180.180.180:80>

#    ServerAdmin [email protected]

     DocumentRoot /var/www/html/cake

     ServerName something.something.com

#    ErrorLog logs/dummy-host.example.com-error_log

#    CustomLog logs/dummy-host.example.com-access_log common

<Directory "/var/www/html/membersarea">

    Options Indexes FollowSymLinks MultiViews

    AllowOverride All

    Order deny,allow

    Allow from all

</Directory>

</VirtualHost>

你可能感兴趣的:(cakephp)