cakephp inside a subdirectory

前端 未结 3 496
刺人心
刺人心 2021-01-27 08:38

I have a problem with cakephp, I can\'t find a way to get cakephp working in a subdirectory. I have a webpage that resides at www.example.com and I want to have cak

3条回答
  •  萌比男神i
    2021-01-27 09:15

    Did you read this page in the book and make the appropriate changes in /app/webroot/index.php?

    Edit:

    The problem is that when I go to www.example.com/cake it requests a CakeController and has no stylesheets loaded.

    This seems to indicate that you have the wrong .htaccess in your site's root (www, htdocs ,public_html or whatever) as it's trying to process the request into the CakePHP structure.

    It should not look like this

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

    Why don't you make life easy for yourself and put CakePHP in the root and move the page(s) that reside at www.example.com into app/webroot. That way it'll behave exactly as you want, i.e:

    www.example.com/staticPage.html - displays the static page.

    www.example.com/users - displays the users index

    Files in webroot are served exactly as if they were in the site's root. Think of the css and javascript files.

提交回复
热议问题