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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-15-2008, 08:56 PM
jcarouth's Avatar
Junior Member
 
Join Date: Sep 2007
Location: College Station, TX
Posts: 6
Send a message via Yahoo to jcarouth
Default Rewrite in .htaccess file redirecting to partial controller

Ok I have an app that absolutely refuses to work with me and I cannot figure out where it's going wrong. I must provide this caveat, I have not yet deployed a ZF powered app using .htaccess, probably because I have to this point been unable to obtain my .htaccess wizard hat.

Ok so here is the application layout
Code:
root
root/app
root/app/conf
root/app/modules
root/app/modules/default
root/app/modules/default/(controllers|views|etc)
root/lib
root/lib/Zend
root/tests
root/web
root/web/index.php
root/.htaccess
The contents of .htaccess are
Code:
RewriteEngine On

RewriteBase /beta1/

RewriteRule !\.(js|css|ico|gif|jpg|png)$ web/index.php
now when I navigate to http://localhost/beta1/, I get
Code:
Invalid controller specified (a1)

#0 /usr/local/apache2/htdocs/beta1/lib/Zend/Controller/Front.php(914): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /usr/local/apache2/htdocs/beta1/lib/Zend/Controller/Front.php(223): Zend_Controller_Front->dispatch()
#2 /usr/local/apache2/htdocs/beta1/lib/Lsg/Bootstrap.php(56): Zend_Controller_Front::run('/usr/local/apac...')
#3 /usr/local/apache2/htdocs/beta1/web/index.php(12): Lsg_Bootstrap->runApp()
#4 {main}
obviously, a1 is the last 2 characters of 'beta1'. Does anyone know why that is happening?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-16-2008, 04:24 PM
jcarouth's Avatar
Junior Member
 
Join Date: Sep 2007
Location: College Station, TX
Posts: 6
Send a message via Yahoo to jcarouth
Default

I got it working.

The problem was that I was specifying a base url to the front controller, i.e. Zend_Controller_Front::getInstance()->setBaseUrl('/lsg');

This has caused the truncation of the controller name by exactly 3 characters.

I moved the url path use in setBaseUrl to a configuration directive and all is well.
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 06:29 AM.