cakephp doesn't work url-rewriting on Ubuntu

天大地大妈咪最大 提交于 2019-12-04 01:32:19
NuclearPeon

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/

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.

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/
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!