【问题标题】:codeigniter page can not be found issue找不到codeigniter页面问题
【发布时间】:2013-01-31 15:11:56
【问题描述】:

我正在开发根目录下的网站,我正在建设页面。我已将新站点的文件上传到文件夹 newsite 中,该文件夹位于根目录中。

我使用 .htaccess 文件从域中删除 index.php。

如果我键入 www.somesite.com/newsite,或 http://www.somesite.com/newsite 显示欢迎控制器。到目前为止,一切顺利。

我有后台管理系统,当我输入: http://www.somesite.com/newsite/folderName/controllername/functionname 我得到 404 错误。

folderName 是放置后台控制器的文件夹的名称。任何人都知道为什么我只在后端收到此错误,而首页正在工作?

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

php_value post_max_size 20M
php_value upload_max_filesize 20M
php_value max_execution_time 6000000

如果我像这样在后台办公室的 url 中添加 index.php http://www.somesite.com/newsite/index.php/folderName/controllername/functionname

然后页面就显示出来了。

问候,卓然

【问题讨论】:

  • 如果您可以发布相关的 .htaccess 和路由规则,我们或许可以提供帮助
  • 我只是编辑帖子,然后添加 .htaccess 的代码,但由于首页没有 index.php,我怀疑问题出在此处。我有默认路由规则,我在浏览器中输入地址,但网站后端出现 404 错误。
  • 你是否在配置中将其指定为 base_url somesite.com/newsite
  • 是的,在配置文件中我有somesite.com/newsite。请重新阅读帖子,我编辑了它一分钟。以前。

标签: .htaccess codeigniter


【解决方案1】:

添加后

.htaccess 中的RewriteBase /newsite/,页面显示出来,现在就像一个魅力。

【讨论】:

  • Zoran,如果这解决了您的问题,我们鼓励您“接受”它作为正确答案(即使是您写的)。
猜你喜欢
  • 2016-08-25
  • 2020-07-14
  • 2019-12-02
  • 1970-01-01
  • 2016-11-14
  • 2015-06-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多