cakephp doesn't work url-rewriting on Ubuntu

后端 未结 3 2302
深忆病人
深忆病人 2021-02-20 03:00

all. This time I try cakephp, but I have got \"URL rewriting is not properly configured on your server. 1) Help me configure it 2) I don\'t / can\'t use URL rewriting\". I could

相关标签:
3条回答
  • 2021-02-20 03:23

    Possible missconfiguration:

    Check if File http://your_domain_name/css/cake.generic.css is rechable from your Browser. If not you will get the warning in the Default-Homepage

    If you have a {HOME}/css Directory at the root level, UrlRewriting will not redirect http://your_domain_name/css/cake.generic.css to {HOME}/app/webroot/css/cake.generic.css.

    Thus the css-File will not be found, causing the Message that URL-rewriting is not properly configured. (Look at File app/View/Pages/home.cpt)

    Solution: Completly remove {HOME}/css Directory at root-level. Put your css-File at {HOME}/app/webroot/css.

    0 讨论(0)
  • 2021-02-20 03:29

    This could be a file permissions problem. Try recursively setting permissions to 777 for both the webroot and tmp directories. The tmp directory might require sudo.

    sudo chmod -R 777 /path/to/app/webroot/
    sudo chmod -R 777 /path/to/app/tmp/
    
    0 讨论(0)
  • 2021-02-20 03:42

    I had this problem as well. Turns out the .htaccess file was not getting copied alongside the cakePHP source. This is a common issue when using the cp command or not having hidden files visible in a file browser, unless you copy the top-level directory.

    Doing a direct copy of the file to my project folder fixed it for me without having to mess with my apache settings.

    cp ~/git/cakePHP/.htaccess ~/project/folder/
    
    0 讨论(0)
提交回复
热议问题