How to config .htaccess files of CakePHP in WampServer?

前端 未结 4 604
灰色年华
灰色年华 2021-01-13 09:07

I\'m absolutely confused about what I must do to run my sample in CakePHP...

I\'m using WAMP Server and it is located in \"C:/program files/wamp/\" and I use anothe

4条回答
  •  借酒劲吻你
    2021-01-13 10:02

    I had same issue and here is solution that worked for me

    this is my cakephp.conf in wamp server

    Alias /cakephp "d:/wamp/apps/cakephp/app/webroot" 
    
    
       Options FollowSymLinks
       AllowOverride all
       Require local
    
    

    This is .htaccess file in /cakephp (not changed anything)

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

    This is .htaccess file in /cakephp/app (not changed anything)

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

    This is .htaccess file in /cakephp/app/webroot (changed)

    
        RewriteEngine On
        RewriteBase /cakephp
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ /webroot/index.php [QSA,L]
    
    

    I just added line this line

    RewriteBase /cakephp
    

    After this I was able to launch url localhost/cakephp/index.php/posts/index

    Hope this will help you to get started with CakePhp using WAMP Server

提交回复
热议问题