EllisLab text mark
Advanced Search
     
ion_auth and css noob problem
Posted: 08 October 2012 02:30 PM   [ Ignore ]
Joined: 2012-10-08
3 posts

I’ve setup ion_auth authentication library, even though it’s not part of the codeigniter codebase I think my question is kida generic, must be related to sessions or something.
My problem is that I’m getting a 404 related to anything from my css until I’m logged in.
I’ve tried to put my css in a [document root]/css folder and point to it by either css/style.css or /css/style.css, and I’ve even tried to copy the css folder to my views/auth/ folder.
I’m new at codeigniter, I must be overlooking mabye something with my routes.php ?
My routes.php have only a few lines of code

$route['auth/(:any)''auth/$1';
$route['(:any)''pages/view/$1';
$route['default_controller''pages/view'

 

 
Posted: 08 October 2012 03:14 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2008-11-26
63 posts

I’ve used ion_auth for quite a few things and I’ve not had any issues with CSS or otherwise.  As long as I specify my css in the HTML, it grabs it from that location I want which is in the document root. 

Have you tried commenting out your extra routes to see if that solves the issue?

 Signature 

Christian D.

 
Posted: 27 October 2012 11:04 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2012-10-08
3 posts

I worked around the problem with something like this in .htaccess:
RewriteRule ^auth/style/(.*)$ http://my.domain/style/$1 [R=301,L]
RewriteCond $1 !^(index\.php|images|robots\.txt|style)
RewriteRule ^(.*)$ /index.php/$1 [L]

I’m gonna have to look into this mor thorough when I got more spare time.

Appreciate your reply !