Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-17-2008, 08:29 PM
Junior Member
 
Join Date: Apr 2008
Location: Germany, Hamburg
Posts: 11
Default Action controller different from index

Next problem: Everything (and any experiment ) with the standard IndexController works fine. But: As soon as I just create a new controller, for example UserController in the same folder as IndexController, I get a simple


Not Found

The requested URL /zend-playground/user/login was not found on this server.
Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.3 Server at localhost Port 80


What wrong this time? Unfortunatly the error seems to be too much standard to find out it's cause =| .

Thanks in advance for your help and hints.

Sebastian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 08:57 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

We need more info.
If you could supply the url you requested, your controller source and routes you have setup...
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk
Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 10:00 PM
Junior Member
 
Join Date: Apr 2008
Posts: 1
Default

yeah i know him ask, and my ask too.

for default : http://localhost/index/action is the the deafult controller.

first i want to rename default controller as the http://localhost/myindex/myaction

and add another http://localhost/myanotherpage/myanotherdo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 10:34 PM
Ewok's Avatar
Junior Member
 
Join Date: Mar 2008
Location: Colorado SPrings
Posts: 16
Send a message via MSN to Ewok Send a message via Yahoo to Ewok
Default

Is your URL rewriting working correctly?
__________________
Give all victory and gain to others
Take all defeat and loss upon yourself
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 03:10 AM
Junior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 8
Default

Yeah, what's in your .htaccess file?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 06:55 AM
Junior Member
 
Join Date: Apr 2008
Location: Germany, Hamburg
Posts: 11
Default

So in my .htaccess is exactly the default:

RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php

The content of UserController.php is simply:

Code:
<?php

class UserController extends Zend_Controller_Action {
	public function indexAction()
	{
		
	}
	
	public function loginAction()
	{
		
	}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-18-2008, 12:56 PM
Junior Member
 
Join Date: Apr 2008
Location: Germany, Hamburg
Posts: 11
Default

No further ideas? Maybe the question has to be: When for example /user/login does not work, although a controller UserController extends Zend_Controller_Action exists in the controllers path, why then does it work with /index/news through a controller IndexController located and build based on the same schema as the user controller? I'm a bit confused and at a loss.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-19-2008, 12:27 AM
Ewok's Avatar
Junior Member
 
Join Date: Mar 2008
Location: Colorado SPrings
Posts: 16
Send a message via MSN to Ewok Send a message via Yahoo to Ewok
Default

I think that your ReWrite engine isn't there. The only time I've ever gotten that error is when I haven't had it running.

Your .htaccess is correct but if the URL were being rewritten correctly you would be getting an error either stating that you don't have an ErrorController or you would see the contents of your error view.
__________________
Give all victory and gain to others
Take all defeat and loss upon yourself
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-19-2008, 09:06 AM
Junior Member
 
Join Date: Apr 2008
Location: Germany, Hamburg
Posts: 11
Default

Ewok, your are absolutly right. I forgot, that on my system rewrite isn't activated globally. I had to configure it for this concrete application. Now it works. Sometimes things are soo easy . Thanks lot for your initial notion.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-25-2008, 05:38 PM
Junior Member
 
Join Date: Apr 2008
Posts: 1
Default

Hi,

I have a similar problem, that I've been banging my head on all day. I've new to ZF so I may be making a simple mistake.

In my .htaccess I also have:
Quote:
RewriteEngine on
RewriteBase /
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
I have no special routes, just:
Zend_Controller_Front::run('../application/controllers')
in index.php.

My IndexController works, and I think that my RewriteRule is fine because http://myhost/mydir/index and http://myhost/mydir/index/index both work correctly, calling ../application/views/scripts/index/index.phtml and the indexAction() of IndexController respectively.

Note: http://myhost/mydir is the base URL where .htaccess and index.php are.

Now, If I call http://myhost/mydir/login, it does not call LoginController.php or ../application/views/scripts/login/login.phtml (as I would have hoped), I get an error in the browser:
Quote:
The requested URL /index.php was not found on this server.
I've read most of the ZF manual and have done much googling - is there a way of tell the Zend_Controller_Front to trace/log its decisions so I can see what it receives, where its is looking, for what etc.? the Log class doesn't see to be for that either.

thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:27 AM.