duanpuqi9965 2012-04-11 20:19
浏览 32

404页面不存在

I'm trying to figure out why I'm getting a 404 page now found when I load a page. I thought it was because of the file structure but now i'm not sure why.

myurl.com/mycms/modules/bios/quotes

Here's the file structure

root
root/mycms
root/mycms/application
root/mycms/application/modules
root/mycms/application/modules/bios/
root/mycms/application/modules/bios/controllers/quotes

<?php

if (!defined('BASEPATH')) exit('No direct script access allowed');

class Quotes extends CI_Controller
{

public function __construct()
{
    parent::__construct();
}

public function index()
{
    //Config Defaults Start
    $msgBoxMsgs = array(); //msgType = dl, info, warn, note, msg
    $cssPageAddons = ''; //If you have extra CSS for this view append it here
    $jsPageAddons = ''; //If you have extra JS for this view append it here
    $metaAddons = ''; //Sometimes there is a need for additional Meta Data such in the case of Facebook addon's
    $siteTitle = ''; //alter only if you need something other than the default for this view.
    //Config Defaults Start


    //examples of how to use the message box system (css not included).
    //$msgBoxMsgs[] = array('msgType' => 'dl', 'theMsg' => 'This is a Blank Message Box...');

    /**********************************************************Your Coding Logic Here, Start*/

    // Checks to see if a session is active for user and shows corresponding view page
    if ($this->kowauth->isLoggedIn())
    {
        $bodyContent = "testing"; //which view file
    }
    else
    {
        redirect('login', 'refresh');
    }
    $bodyType = "full"; //type of template

    /***********************************************************Your Coding Logic Here, End*/

    //Double checks if any default variables have been changed, Start.
    //If msgBoxMsgs array has anything in it, if so displays it in view, else does nothing.
    if (count($msgBoxMsgs) !== 0)
    {
        $msgBoxes = $this->msgboxes->buildMsgBoxesOutput(array('display' => 'show',
            'msgs' => $msgBoxMsgs));
    }
    else
    {
        $msgBoxes = array('display' => 'none');
    }

    if ($siteTitle == '')
    {
        $siteTitle = $this->metatags->SiteTitle(); //reads
    }

    //Double checks if any default variables have been changed, End.

    $this->data['msgBoxes'] = $msgBoxes;
    $this->data['cssPageAddons'] = $cssPageAddons; //if there is any additional CSS to add from above Variable this will send it to the view.
    $this->data['jsPageAddons'] = $jsPageAddons; //if there is any addictional JS to add from the above variable this will send it to the view.
    $this->data['metaAddons'] = $metaAddons; //if there is any addictional meta data to add from the above variable this will send it to the view.
    $this->data['pageMetaTags'] = $this->metatags->MetaTags(); //defaults can be changed via models/metatags.php
    $this->data['siteTitle'] = $siteTitle; //defaults can be changed via models/metatags.php
    $this->data['bodyType'] = $bodyType;
    $this->data['bodyContent'] = $bodyContent;
    $this->data['userData'] = $this->users->getUserByUserID($this->session->userdata('userID'));
    $roster = $this->kowauth->getRosterList($this->data['userData']->usersRolesID);
    $userRoster = array();
    foreach ($roster AS $member)
    {
        $userRoster[$member->id] = $member->rosterName;
    }
    $this->data['userRoster'] = $userRoster;
    $this->data['personalMessages'] = array($this->pmmodel->
        getInboxUnreadMessagesCount($this->session->userdata('userID')), $this->pmmodel->
        getInboxMessagesCount($this->session->userdata('userID')), $this->pmmodel->
        getLast5Messages($this->session->userdata('userID')));
    $this->load->view('cpanel/index', $this->data);
}
}

/* End of file quotes.php */
/* Location: ./application/modules/bios/controllers/quotes.php */

htacess:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

RewriteEngine On
RewriteBase /kowmanager
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

I don't have any custom routes.

  • 写回答

1条回答 默认 最新

  • dpyic24480 2012-04-12 07:40
    关注

    Usually when using modules with CI you don't need to include the word "modules" in your URL. Try accessing myurl.com/mycms/bios/quotes It might be that your cms works in a different way, but generally the theory is that any controllers in your modules are accessed simply by using the module name and then the controller name. If you think about using CI without modules you wouldn't use the word "controllers" in the URL.

    评论

报告相同问题?

悬赏问题

  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)