Where do I put image files, css, js, etc. in Codeigniter?

前端 未结 14 1234
挽巷
挽巷 2020-11-30 16:57

Where is it acceptable to put css folders and image file folders? I was thinking inside the view folder? However the controller always reroutes the path to the base url so I

14条回答
  •  长情又很酷
    2020-11-30 17:23

    No one says that you need to modify the .htacces and add the directory in the rewrite condition. I've created a directory "public" in the root directory alongside with "system", "application", "index.php". and edited the .htaccess file like this:

    RewriteCond $1 !^(index\.php|public|robots\.txt)
    

    Now you have to just call You can add subdirectory inside "public" dir as you like.

提交回复
热议问题