Welcome Guest, Not a member yet? Register   Sign In
CSS and .htaccess
#1

[eluser]kimp[/eluser]
I notice that the .htaccess file in the user guide doesn't make an exception for .css files.

What's the best way to deal with this?

Personally I just created the exception for the styles directory. The only other alternative I can see is to locate the files outside of code igniter tree. Or am I missing something?
#2

[eluser]bretticus[/eluser]
It does actually. See:

http://codeigniter.com/wiki/mod_rewrite/

Code:
#Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

Real files and directories are not handled by codeigniter in this rewrite config from the wiki.

Your styles folder should be at the same level as index.php or if you stick index.php in it's very own virtual root folder (for best security) in the virtual root folder.
#3

[eluser]kimp[/eluser]
Thanks bretticus. I was looking at http://ellislab.com/codeigniter/user-gui.../urls.html, which is clearly an abbreviated version!
#4

[eluser]bretticus[/eluser]
It's been awhile. I forgot where that .htaccess file example came from. They should update the manual! :-)




Theme © iAndrew 2016 - Forum software by © MyBB