CakePHP v2 named Model same as folder in webroot

toggle_me_elmo

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!

Jaysukh Maghodiya

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)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Cakephp app/webroot/img folder is directly accessible

From Dev

Cakephp webroot displaying in the URL

From Dev

CakePHP 2.4.1 $this->webroot gives / and not /app/webroot

From Dev

How to associate model in CakePHP by fields not named by convention?

From Dev

How to add custom folder with custom name inside webroot directory in Cakephp 3

From Dev

Link the same model twice to another model in CakePhp

From Dev

Link the same model twice to another model in CakePhp

From Dev

Routing users to webroot subfolder in cakephp

From Dev

Saving Multiple record related to the same Model in Cakephp

From Dev

Multiple Associations to the Same Model in CakePHP 3

From Dev

Cakephp 3.0 - Multiple relations to the same model

From Dev

Saving Multiple record related to the same Model in Cakephp

From Dev

CakePHP - Saving and serving files outside of webroot

From Dev

CakePHP DebugKit / Plugins webroot not being found

From Dev

How to run php file in webroot of cakephp project

From Dev

CakePHP can not find webroot/css/js files

From Dev

CakePHP 3 Serve Files From Plugin Webroot

From Dev

Using Named parameters in CakePHP 2.x

From Dev

multiple model validation cakephp 2

From Dev

Compass Sprite Sheet Paths with Webroot Folder

From Dev

What permissions are needed to write to folder outside of webroot?

From Dev

Compass Sprite Sheet Paths with Webroot Folder

From Dev

Permissions for apache webroot folder on dev server?

From Dev

Vagrant adds 'webroot' folder to my development enviroment

From Dev

Merge 2 text files to one in every subfolder and save them in the same Folder as Date and File named csv file.

From Dev

How to include a php file from directory named "files" in CakePHP 1.3 folder structure?

From Dev

CakePHP updating multiple rows with record ids, same model

From Dev

Model association on same table (for menu and submenu concept) in cakephp 3.2

From Dev

CakePHP updating multiple rows with record ids, same model

Related Related

  1. 1

    Cakephp app/webroot/img folder is directly accessible

  2. 2

    Cakephp webroot displaying in the URL

  3. 3

    CakePHP 2.4.1 $this->webroot gives / and not /app/webroot

  4. 4

    How to associate model in CakePHP by fields not named by convention?

  5. 5

    How to add custom folder with custom name inside webroot directory in Cakephp 3

  6. 6

    Link the same model twice to another model in CakePhp

  7. 7

    Link the same model twice to another model in CakePhp

  8. 8

    Routing users to webroot subfolder in cakephp

  9. 9

    Saving Multiple record related to the same Model in Cakephp

  10. 10

    Multiple Associations to the Same Model in CakePHP 3

  11. 11

    Cakephp 3.0 - Multiple relations to the same model

  12. 12

    Saving Multiple record related to the same Model in Cakephp

  13. 13

    CakePHP - Saving and serving files outside of webroot

  14. 14

    CakePHP DebugKit / Plugins webroot not being found

  15. 15

    How to run php file in webroot of cakephp project

  16. 16

    CakePHP can not find webroot/css/js files

  17. 17

    CakePHP 3 Serve Files From Plugin Webroot

  18. 18

    Using Named parameters in CakePHP 2.x

  19. 19

    multiple model validation cakephp 2

  20. 20

    Compass Sprite Sheet Paths with Webroot Folder

  21. 21

    What permissions are needed to write to folder outside of webroot?

  22. 22

    Compass Sprite Sheet Paths with Webroot Folder

  23. 23

    Permissions for apache webroot folder on dev server?

  24. 24

    Vagrant adds 'webroot' folder to my development enviroment

  25. 25

    Merge 2 text files to one in every subfolder and save them in the same Folder as Date and File named csv file.

  26. 26

    How to include a php file from directory named "files" in CakePHP 1.3 folder structure?

  27. 27

    CakePHP updating multiple rows with record ids, same model

  28. 28

    Model association on same table (for menu and submenu concept) in cakephp 3.2

  29. 29

    CakePHP updating multiple rows with record ids, same model

HotTag

Archive