Welcome Guest, Not a member yet? Register   Sign In
bypass images directory
#1

[eluser][email protected][/eluser]
Hey guys,

We just encountered an error that took us about 4 days to figure out. The problem was that our flash session data was all of the sudden disappearing.

The culprit was one missing image file being loaded through a CSS file. CI was looking for /images/closelabel.gif and couldn't find so it threw a 404 error in the background; while still displaying the correct page. Since we were using flash_data the 404 cleared out the session because it was a CI request.

So...what do you guys think the best way to resolve this would be ??
A) Somehow get CI to bypass /images/ directory when it is loading (not sure how to do this)
B) Not use flash_data
C) Have all your images exist at all times (not very predictable cause you can make a mistake)
D) any other suggestions????

thanks.
#2

[eluser]The Fox[/eluser]
Are you using CI to send all your images to the browser? Like you have a controller called images that you use to send your GIFs? (Just making sure I understand you.)

I think option A is your best choice. I have Apache configured to rewrite all requests to my CI app, except those requests for a few certain files and directories. I.E. requests for example.com/controller/method/ are sent behind-the-scenes to example.com/index.php/controller/method so CI can handle them. In fact, anything after the first slash is always sent to index.php, except for the following folders and files: /graphics, /icons, /js, /css, robots.txt, favicon.ico, etc... These files and directories are handled by the web server like normal.

Here's the Apache configuration for that. I put this in my vhost file. Not sure if you can do this with .htaccess or not.

Code:
<IfModule mod_rewrite.c>
    RewriteLogLevel        0
    RewriteLog /your-optional-log-file
    RewriteEngine On
    RewriteCond %{REQUEST_URI}
    !^(/index\.php|/graphics|/icons|/js|/css|/robots\.txt|/favicon\.ico)
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>




Theme © iAndrew 2016 - Forum software by © MyBB