cakephp CSS suddenly has stopped working
So I've been working on a website recently, and was messing around with th开发者_StackOverflow社区e pages controller, to try to figure out how to create dynamic pages. I couldn't for the life of me figure out what was wrong with the setup I had going, so I decided to revert to the default pages_controller.php in /cake, deleting mine.
I created a view in /pages called philosophy.ctp, and visited both area51.owlhouse/philosophy and area51.owlhouse/pages/philosophy and neither worked. So I decided to use a fresh install with my app and database in place- essentially just replacing /cake, index.php, /plugins and /vendors.
I reload my front page and it's just text. I have a theme for the site but it's just not registering. Same with the default theme, nothing works.
rewrite_module is on. What is wrong with my site? Ever since replacing the system files in cake CSS refuses to load. HELP!
Expanding this for newbies, as I've been asked this 20 times over the last year while bringing new devs onto Cake.
This is most commonly caused by Apache rewrite rules not working.
1. Verify that your rewrite rules are in place.
If you have a default setup using the .htaccess files included with Cake, verify that they are in the correct location(s):
/app/webroot/.htaccess
/.htaccess
Note: If you're doing this, you should consider moving the rewrite rules to your virtual host definition and pointing the root to /app/webroot/. A good walkthrough may be found here: http://bakery.cakephp.org/articles/rynop/2010/09/10/boost_performance_by_removing_htaccess_plus_multi-site_with_virtualdocumentroot
Alternatively if you've moved the rewrite rules to your virtual host configuration, verify that the rules are set up correctly.
2. Verify that mod_rewrite is enabled in Apache.
精彩评论