Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9173967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:40:27+00:00 2026-06-17T16:40:27+00:00

I am working in my first CodeIgniter project… After building most of my PHP

  • 0

I am working in my first CodeIgniter project…

After building most of my PHP and start playing with the almost finished scrip I realized that all access to application/views/ folder is denied by the .htaccess.

This is a huge problem for my file structure when I want to access page-specific JavaScript, Images or any web-resource folder. Since all my views template assumes that the file is used locally (That being Page_name/images/cutedog.jpg, in my code more precisely <img src="{images}cutedog.jpg">).

The solution that I found is modifying the .htacces so that it filters out all media files and it allows access to my application folder. But then by doing that I would reveal my file structure which I would rather avoid.

I know what I could just place my web resources outside my application folder and that would solve the problem. But for maintainability purposes I think it would be more logic to have everything as it is right now.

So my question is at follows… What work around would you suggests so that:
– I can maintain my web resources at application/views/issue/WEB_PAGE/Web-resource-folder
– keep my file structure hidden
– web-resources can be accessed

my .htaccess

Deny from all
<FilesMatch "\.(css|js|jpg|pdf|avi|mpg|robots\.txt|png|pdf|favicon\.ico)$">
    Order allow,deny
    Allow from all
</FilesMatch>

My file structure:

-+ /application/
 |
 |-+ /Typical CI folders/        
 |-+ /view/
   |-+ /issue/
     |-+ /1/
       |-+ /page1/
         |-+ /img/
         |-+ /js/
         |-+ /video/
       |-+ /page2/
         |-+ /img/
         |-+ /js/
         |-+ /video/
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:40:28+00:00Added an answer on June 17, 2026 at 4:40 pm

    You will need to write complicated rewrite rules for that which will tell .htaccess something like:

    if url is blah/bloh/blih/WEB_PAGE/images/cutedog.jpg 
    then fetch application/views/issue/WEB_PAGE/img/cutedlog.jpg
    

    If you ask me that is going to become more and more cumbersome as you create more resources. Like you suggested you should place your web resources outside your application folder.

    My CI Structure always looks like this:

    /application
    /resources
       /page1
          /img
          /js
          /video
       /page2
          /img
          /js
          /video
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a new php project with CodeIgniter and I have few questions
Working on my first Rails project, I used Ryan Bates' Nifty-Generators to create the
I working on my first ASP.net MVC project and and i got some problems
i am working on my first Ajax Project and i cannot find a solution
I'm currently editing a working project with some experience on PHP. I know a
I'm just about finished my first release of automailer, a program I've been working
We're building a PHP app based on Good old codeigniter framework and have run
First off let me start by saying I am using CodeIgniter and the Facebook
I am uploading site very first. I have used php,phpmyadmin, and CodeIgniter frame work
I'm working on a CodeIgniter project in which I'm using Doctrine2 and the Symfony2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.