Welcome Guest, Not a member yet? Register   Sign In
404 Page Not Found
#11

[eluser]InsiteFX[/eluser]
Did you change your application/config/routes.php file to point
to your new default controller?

InsiteFX
#12

[eluser]ubuntuman[/eluser]
@WanWizard - I am running windows 7 OS, Wamp server, read-write permission. How do I enable CI logging.

@InsiteFX - Yes! I change the application/config/routes.php file to point to my new controller. still did not work.
#13

[eluser]techgnome[/eluser]
may sound like a stupid question, but I ask because I've done it myself...
But when you renamed the .php controller file to a new name... you did remember to change the Class name inside the file to match, right? And, in addition, changed the name of the constructor function, too right?

AND.... (and this is something I got snagged on too) ... you didn't use a reserved word by any chance did you? http://ellislab.com/codeigniter/user-gui...names.html

-tg
#14

[eluser]InsiteFX[/eluser]
Post the code to your controller and use code tags!

InsiteFX
#15

[eluser]ubuntuman[/eluser]
My Viewer "home_message.php"
Code:
<style type="text/css">

body {
background-color: #fff;
margin: 40px;
font-family: Lucida Grande, Verdana, Sans-serif;
font-size: 14px;
color: #4F5155;
}

a {
color: #003399;
background-color: transparent;
font-weight: normal;
}

h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 16px;
font-weight: bold;
margin: 24px 0 2px 0;
padding: 5px 0 6px 0;
}

code {
font-family: Monaco, Verdana, Sans-serif;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}

</style>
</head>
<body>

<h1>Welcome to CodeIgniter!</h1>

<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>

<p>If you would like to edit this page you'll find it located at:</p>
<code>system/application/views/welcome_message.php</code>

<p>The corresponding controller for this page is found at:</p>
<code>system/application/controllers/welcome.php</code>

<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="../../../application/views/user_guide">User Guide</a>.</p>


<p><br />Page rendered in {elapsed_time} seconds</p>

&lt;/body&gt;
&lt;/html&gt;

My Controller - homepg.php
Code:
&lt;?php

class Home extends Controller {

    function index()
    {
         $this->load->view('home_message');
    }

}

My routes.php
Code:
$route['default_controller'] = "homepg";
$route['scaffolding_trigger'] = "";
#16

[eluser]ubuntuman[/eluser]
@TechGnome - I checked everything and its ok.
#17

[eluser]ubuntuman[/eluser]
Did anyone encounter this problem? I am just fed-up with this thing.
#18

[eluser]ubuntuman[/eluser]
Got it!

I am so dumb! Really dumb! The route was set to the viewer and not the controller file.
Thanks anyway guys.
#19

[eluser]InsiteFX[/eluser]
You are missing the constructor for 1

Also your controller is home.php not homepg.php
The controller filename should be the name of the
controller home.php

Code:
class Home extends Controller {

    function Home()
    {
        parent::Controller();
    }

    function index()
    {
        $this->load->view('home_message');
    }
}

Then change the default controller in routes.php to home.

InsiteFX
#20

[eluser]Unknown[/eluser]
Hi,

I've got pretty much exactly the same problem. The only way I get my code to work is to use welcome.php as a controller, nothing else works. It's sort of ok, through welcome.php I can use other view files, but I'd suppose there should be a way to also change the file name somehow...

I've changed the "$route['default_controller']" in routes.php, which was the only file I found "welcome.php" being mentioned. Change this to any other controller file than "welcome.php" and I get 404... Welcome.php itself works just fine. If I change the "$this->load->view" to my own file it work ok.




Theme © iAndrew 2016 - Forum software by © MyBB