doupu2722 2018-10-12 10:27
浏览 63

codeigniter url中的访问被拒绝错误是index.php

I am having issue which is may be related to .htaccess or php configuration of ubuntu. I have tried lot to find out solution but feels helpless so, at last i decided to post a question here. May be my question is silly or may i am making mistake on very normal configuration point but at last i hope my question will helps me to find out a solution with all yours blessings..

Please, support me to find out way for my issue.

My issue is when i am opening url without having index.php in url it gives output success but once i put index.php in url it gives only "Access Denied" in response.

Example

It gives me "Access Denied" in response

It gives access denied

It working fine but my all url change took longer time to change

It's working fine

MY .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>

I can't find way to come out from this issue. your help will be appreciated

Thanks for visiting...

  • 写回答

1条回答 默认 最新

  • dp7311 2018-10-12 10:46
    关注

    try to put these on your .htaccess
    i always use it on apache server and it works

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

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等