2

My cakephp is not loading any css,js. i uncommented the line Configure::write('App.baseUrl',env('SCRIPT_NAME')); in core.php. and now get all the css and js but I get missing controllers. I have to put index.php in the url. eg:-http://localhost/myapp/index.php/login i enabled the mod_rewrite but still its not working

1 Answer 1

1

If you are NOT using mod_rewrite, then you must:

A. Uncomment Configure::write('App.baseUrl', env('SCRIPT_NAME')); (which you said you've done)

B. Remove or disable your 3 .htaccess files (you haven't mentioned doing this...)

/.htaccess

/app/.htaccess

/app/webroot/.htaccess

Don't delete the files, just rename them to eg. .htaccessXXX so you can easily re-enable them later. Also remember .htaccess are hidden files - so Google "how to show hidden files" if you can't already see them in your file browser.

C. You must include index.php in all your URLs. Eg. http://www.example.com/index.php/my_controller/my_action

Did you remember to do step 2 - disable your .htaccess files?

And remember that if you want to re-enable mod_rewrite again, then you must undo ALL the above three things, ie, comment out Configure::write('App.baseUrl', env('SCRIPT_NAME'));, enable all 3 .htaccess files, and no longer include /index.php in your URLs.

But the biggest question here is, are you really using Cakephp 1.2? This question has been tagged CakePHP 1.2 - but Version 2.1 is out now, so you should probably be using that.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks joshua, its all issue with mod_rewrite.and also i played with etc. so i just reconfigured my lamp. its running fine now. and thanks for your advice, i decided to change the cakephp version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.