Welcome Guest, Not a member yet? Register   Sign In
Codeignitor 2.0 and 403 forbidden
#1

[eluser]Unknown[/eluser]
I'm new to codeignitor 2.0. I created a new folder named 'media' in /application to store images and css. But I'm not able to access the page either from the script or directly. Yes, base base_url is set up and url helper is loaded. I'm using wamp server 2 and I'm on windows 7.
Code:
<link rel="stylesheet" href="<?php echo base_url().'application/media/style.css'; ?>" type="text/css">

http://localhost/c4f/application/media/style.css

Forbidden

You don't have permission to access /c4f/application/media/style.css on this server.


I know this has to do with codeignitor setup because I can't access any folder through browser directly and I can't find anything in the userguide or in the forum on how to do this.
#2

[eluser]mi6crazyheart[/eluser]
Take out u'r "media" folder out of application folder & keep it in same level with "application" folder & "system" folder present. Like this..

-application
-media
-system
-user_guide

Now, u can access u'r style.css(present inside media folder) by this..
Code:
<link rel="stylesheet" href="<?php echo base_url(); ?>media/style.css" />
#3

[eluser]Unknown[/eluser]
Thanks.
#4

[eluser]gserrano[/eluser]
I was updating my application from 1.7 to 2.0 CI version, everything ok in my dev apache, but when i put to prod server all images as css in /application/views got 403.

my structure is

/application/views/css
/application/views/images

I don't want to move my css and media out /application now 'cause it will be hard to test all application with new urls.

My .htaccess has:
Code:
RewriteRule ^css/(.*)$ application/views/css/$1 [L]
RewriteRule ^js/(.*)$ application/views/js/$1 [L]
RewriteRule ^images/(.*)$ application/views/images/$1 [L]
RewriteCond $1 !^(index\.php|images|robots\.txt|application\/views)
RewriteRule ^(.*)$ /index.php/$1 [L]

I don't know what to do 'cause in localhost is working fine Sad
#5

[eluser]toopay[/eluser]
Check your directory permission. 403 at Apache/IIS is related with permission.




Theme © iAndrew 2016 - Forum software by © MyBB