On Mon, Sep 28, 2009 at 10:56 AM, dong.l...@gmail.com
<dong.l...@gmail.com> wrote:
>
> Dear all,
>
> I have existed html files for one website, I would like to intergrate
> them with cakephp to add some dynamic methods. At the same time, I
> want to keep all the old static pages to save time. When I put html
> pages in the root folder, it still handle by cakephp. I know it
> because the .htaccess file will look for index.php file in the webroot
> folder first.
>
> So how can I change the .htaccess file to make it work. I want it can
> look for .html files first, if no html files, then it looks for
> index.php.
>
> Below is oringal .htaccess file
>
> <IfModule mod_rewrite.c>
>   RewriteEngine on
>   RewriteRule    ^$ app/webroot/
>   RewriteRule    (.*) app/webroot/$1 [L]
> </IfModule>

There's no need to change any of the .htaccess files. Put your HTML
files in app/webroot. The .htaccess file in that directory will only
pass the request to Cake if the file or directory does not exist
there. Note the 2 RewriteCond lines:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to