当前位置首页 > Apache知识

Mod_rewriteinCakephpusingApache

阅读次数:472 次  来源:admin  发布时间:

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 webmaster@dummy-host.example.com
     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>
上一篇:nginx与Apache的优缺点
下一篇:MyBatis报错org.apache.ibatis.session.defaults.DefaultSqlSessionFac