繁体   English   中英

Codeigniter URL中的访问被拒绝错误具有index.php

[英]Access denied error in codeigniter url is having index.php

我遇到的问题可能与ubuntu的.htaccess或php配置有关。 我已经尽力寻找解决方案,但感到无助,所以最后我决定在这里发布一个问题。 可能是我的问题很愚蠢,或者是我在非常正常的配置点上犯了错误,但最后我希望我的问题会帮助我找到您所有的祝福的解决方案。

请支持我找出解决问题的方法。

我的问题是,当我在没有url的index.php情况下打开url时,它会输出成功,但是一旦我将index.php放入url,它就会在响应中仅给出“拒绝访问”。

它给了我“拒绝访问”的响应

它使访问被拒绝

它工作正常,但我所有的URL更改花费了更长的时间才能更改

一切正常

我的.htaccess

<IfModule mod_env.c>
    SetEnv CI_ENV development
</IfModule>

<IfModule mod_rewrite.c>

RewriteEngine On
#RewriteBase /CodeIgniter_2.0.3

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

#Checks to see if the user is attempting to access a valid file,
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#Enable access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index\.php|assets|files|robots\.txt)
RewriteRule ^(.*)$ index.php?$1 [L]

</IfModule>
#Allow access from all domains for webfonts.
<IfModule mod_headers.c>
  <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css|js|jpg|jpeg|png|gif|swf)$">
    Header set Access-Control-Allow-Origin "*"
    Header set Cache-Control "max-age=604800, public"
  </FilesMatch>
</IfModule>

我找不到办法解决这个问题。 您的帮助将不胜感激

感谢造访...

尝试将它们放在您的.htaccess文件中
我总是在apache服务器上使用它,并且可以正常工作

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM