Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
227 views
in Technique[技术] by (71.8m points)

assets - Cakephp - not loading css and js

I'm a rails developer doing some patchwork on a cakephp project.

I pulled from a repository and am trying to get a local version of the project up and running.

Right now, the application is trying to load assets from 'localhost/static/css'

The css is actually located in localhost/app-name/app/webroot/static/css.

I've renamed all the htaccess files (app-name/.htaccess, app/.htaccess, app/webroot/.htaccess) and commented them out, but the app is still looking for my assets at 'localhost/static/'.

What am I missing?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need the .htaccess files!

Do you have mod_rewrite installed and enabled?

Do you have allow_override All set for your application webroot in you apache config? (So apache will read the CakePHP .htaccess files)

Did you clear the cache? (Remove all the files, but leave the directories in place in app/tmp - and make sure app/tmp is readable/writable by the webserver

Are you missing a symbolic link? I store my assets outside of webroot and symbolically link the directories (css, js, img, etc.) to /app/webroot


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...