Install Cakephp into a subfolder

I am new to cakephp. I had a previous cakephp project in the root folder (Ex: www.example.com), now I moved the files to "folder1" (ex: www.example.com / folder 1). The site works, but images and other subpaths point to the old root link.

folder1 .htaccess

<Limit GET POST>
#require valid-user
</Limit>
<IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteBase /folder1/
        RewriteRule    ^$ app/webroot/    [L]
        RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

      

folder1 / app

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /folder1/
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
 </IfModule>

      

folder1 / app / webroot

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /folder1/

    # Add trailing slash to urls
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{0,5})$
    RewriteRule ^(.*)([^/])$ $1$2/ [R=301,L]

    # Skip files and pass requests to cake
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

      

Sorry for my bad english.

Please help me to solve this problem.

+3


source to share


1 answer


Try this, go to app / config / core.php and change this line,



Configure::write('App.fullBaseUrl', 'http://localhost/folder1');

+1


source







All Articles