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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-25-2008, 09:37 PM
mime's Avatar
Junior Member
 
Join Date: Apr 2008
Location: Sweden
Posts: 2
Question Redirect index to none index?

Hi all, i'm pretty new to Zend Framework but I have a question about redirecting.

How do I redirect index to the none index equivalent?

example.com/index 301 redirect to --> example.com/

Since both URLs calls the same indexAction the http://www.example.com/index is redundant and should never be used if you ask me.

Last edited by mime : 05-07-2008 at 02:05 PM. Reason: making the question stand out more...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old Yesterday, 11:39 PM
mime's Avatar
Junior Member
 
Join Date: Apr 2008
Location: Sweden
Posts: 2
Lightbulb Found the answer

It took me a while, but I finally found an answer to the index redirect.

Code:
// If the URL is controller/index
if('index' == substr($_SERVER['REQUEST_URI'], -5, 6))		
{	
    // Make a 301 redirect to the same controller without the index
    $this->_helper->redirector('index', $this->getRequest()->getControllerName());
    $this->_helper->redirector->setCode(301);
}
Hope that this can make someone happy out there...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old Today, 08:13 AM
lcf's Avatar
lcf lcf is offline
Junior Member
 
Join Date: Apr 2008
Location: Russian Federation
Posts: 3
Send a message via ICQ to lcf Send a message via Skype™ to lcf
Default

For what this may need?
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 11:51 AM.