user3653474
user3653474

Reputation: 3854

403 Forbidden : You don't have permission to access in Codeigniter

I am trying to run a codeigniter project in wamp server but i'm getting following error :

Forbidden You don't have permission to access /ecommerce_app/application/install/index on this server.

This is my project .htaccess file:

Deny from all
<FilesMatch "\.(gif|jpe?g|png|css|js)$">
Order allow,deny
Allow from all
</FilesMatch>

Url for my project: localhost/ecommerce_app/application/install/index

Please help to solve my issue.

Upvotes: 0

Views: 5901

Answers (1)

theEUG
theEUG

Reputation: 409

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /app_subdirectory/

    RewriteCond $1 !^(index\.php|images|robots\.txt)

    #Removes access to the system folder by users.  
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php/$1 [L]

    #This snippet prevents user access to the application folder
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php/$1 [L]

    #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]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

Upvotes: 2

Related Questions