【问题标题】:403 Forbidden : You don't have permission to access in Codeigniter403 Forbidden : 您无权访问 Codeigniter
【发布时间】:2018-06-07 14:06:20
【问题描述】:

我正在尝试在 wamp 服务器中运行 codeigniter 项目,但出现以下错误:

禁止访问您没有访问权限 /ecommerce_app/application/install/index 在此服务器上。

这是我的项目 .htaccess 文件:

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

我的项目的网址:localhost/ecommerce_app/application/install/index

请帮助解决我的问题。

【问题讨论】:

  • 你不是告诉 apache 拒绝所有人的每个文件,除了以 gif、jpeg、png、css 和 js 结尾的文件吗?还是我看错了。
  • 如果你在 linux 上运行 wamp 服务器检查文件夹权限
  • @LomeshKelwadkar:它的窗口和我正在使用 wamp

标签: php codeigniter codeigniter-2


【解决方案1】:
<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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-07
    • 2023-03-08
    • 1970-01-01
    • 2017-06-22
    • 2021-12-27
    • 2019-02-16
    • 2013-09-27
    相关资源
    最近更新 更多