toggle_me_elmo
toggle_me_elmo

Reputation: 13

CakePHP v2 named Model same as folder in webroot

This is on CakePHP version 2. I had been following the blog guide to create a website and I wanted to add a model to store photos in the database. I created a new Model called Photo with PhotosController. What I didn't realize is that it would conflict with a folder called photos in my webroot. When I generate a link to controller => photos, action => index, or even type in domain.com/photos it redirects to domain.com/app/webroot/photos. While it used to show the files, I deleted the folder on the webroot because I wanted it to go to the index function of PhotosController. Even with that folder gone, it keeps trying to go to that no matter what I've tried.

From the research I've done, I believe it has something to do with mod_rewrite. Is there a way to tell it to forget that at one time there was a webroot folder named photos?

Thanks!

Upvotes: 1

Views: 84

Answers (1)

Jaysukh Maghodiya
Jaysukh Maghodiya

Reputation: 369

You can use route Router::connect('/photo', array('controller' => 'photos', 'action' => 'index'));

Seems you face browser caching, check with private browsing chrome(ctrl+shift+N)

Upvotes: 1

Related Questions