⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

error 404 problem



monia
  • profile picture
  • Member

Posted 03 September 2013 - 14:14 PM

Hi, I'm very new to codeigniter and grocerycrud, actually I downloaded them and started to play with them yesterday. And ofcourse I have a problem from the very beginnig. I want to make a website with CMS but first I need to learn how everything works. I used example no. 2 - creating the structure of the website from this blog: http://philsturgeon.co.uk/blog/2009/07/Create-an-Admin-panel-with-CodeIgniter

My test website is here: http://madeyoulookdigital.co.uk/newcms/ and it works ok

My CMS is here http://madeyoulookdigital.co.uk/newcms/admin/manage and it shows error 404

As per example from the blog I put grocerycrud files to appropriate folders, manage files are in controllers/admin/manage.php and views/admin/manage.php, I also added routing

 

$route['admin'] = "admin/manage";

 

but it still doesn't work. What do I do wrong? I attach a printscreen with the structure of my website.

 

 

 


mnish
  • profile picture
  • Member

Posted 03 September 2013 - 17:22 PM

Hello and welcome to the forums monia.

 

Your problem is related to codeigniter. you can try this-

 

1. actually you want to remove index.php from url so if i am right then you have to made some changes into your .htaccess file.

 

2. if you want to create front-end and backend separately then why are you create two folder in controller just add two controller file and set permission in their constructor.

 

read documentation carefully.


davidoster
  • profile picture
  • Member

Posted 04 September 2013 - 03:15 AM

Hello [member=monia], I think too it is a path issue that needs careful consideration of your .htaccess file settings.

You might want to try first without removing the index.php from the path and see if everythink works fine.


monia
  • profile picture
  • Member

Posted 04 September 2013 - 11:12 AM

thank you for you fast replies :)

I added index.php into the url and now http://madeyoulookdigital.co.uk/newcms/index.php/admin/manage shows:

 

An Error Was Encountered

Unable to load the requested file: manage.php

 

[member='mnish'] you ask why do I use second folder in controller - I wanted to separate the admin (crud) files from the website files - it will be bigger and more complicated project in the future and I wanted frontend and backend to be in separated places. I chose second example from this blog because I thought it's the best way of doing it. Was I wrong?

Another thing, I added a .htaccess file as per CodeIgniter user guide:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

but it doesn't work when I remove index.php from the url....


davidoster
  • profile picture
  • Member

Posted 04 September 2013 - 11:24 AM

Remove the Rewrites and keep index.php on the url and see what happens.


monia
  • profile picture
  • Member

Posted 04 September 2013 - 12:03 PM

you mean to remove .htaccess file? Done - but it still displays the error

An Error Was Encountered

Unable to load the requested file: manage.php

 

http://madeyoulookdigital.co.uk/newcms/index.php/admin/manage

 

:( :( :(


monia
  • profile picture
  • Member

Posted 04 September 2013 - 12:04 PM

I also tried to remove routing

$route['admin'] = "admin/manage";

but it's the same no matter if I use routing or not


Amit Shah
  • profile picture
  • Member

Posted 04 September 2013 - 12:22 PM

brother..

1 thing.. possible what i see is - you trying to access manage.php ... or is it Manage.php ???

Linux is case sensitive !! -

Secondly.. check your code.. class name given.. if it is not

class Manage / manage ... it wont be accessible by any means.

 

Many developers do the mistake.. take in the example.php .. rename it to manage.. alter the functions.. but fail to rename the class inside the file.. that is 1 reason it should fail ... else it should surely work.


monia
  • profile picture
  • Member

Posted 04 September 2013 - 13:03 PM

I'm a woman :)

My file is called manage.php, not Manage.php

I changed the class to Manage because it was Example before so I assumed the class name should begin with uppercase letter and called the same as the file. So I have no idea what do I do wrong....


monia
  • profile picture
  • Member

Posted 04 September 2013 - 13:18 PM

aha :P

I fixed it - I had to change the path in:

public function _manage_output($output = null)
{
	$this->load->view('admin/manage.php',$output);
}

thanks guys for all your help, I'm sure I'll it won't be my last question ;)


Amit Shah
  • profile picture
  • Member

Posted 05 September 2013 - 12:24 PM

sorry for the brother - i didnt see the name .. just went in the flow :D ... but happy could be of the help .. happy GCing!!