Skip to content

Commit

Permalink
added 301 redir codes to ad not found view
Browse files Browse the repository at this point in the history
  • Loading branch information
jipipayo committed May 16, 2012
1 parent 2edde7b commit e211cee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/controllers/AdController.php
Expand Up @@ -48,7 +48,7 @@ public function listAction()
//dont accept other values than give/want
$this->getResponse()->setHttpResponseCode(404);
$this->_helper->_flashMessenger->addMessage($this->view->translate('this url does not exist'));
$this->_redirect('/' . $this->lang . '/woeid/' . $this->location . '/give');
$this->_redirect('/' . $this->lang . '/woeid/' . $this->location . '/give', array('code'=>301));


}
Expand Down Expand Up @@ -95,7 +95,7 @@ public function listAction()
//TODO , this sucks, do a better way to not show invalid woeids or null
if ((empty($woeid)) || ($woeid < 10) || ($woeid == 29370606)) { //29370606 españa town
$this->_helper->_flashMessenger->addMessage($this->view->translate('This location is not a valid town. Please, try again.'));
$this->_redirect('/' . $this->lang . '/location/change');
$this->_redirect('/' . $this->lang . '/location/change',array('code'=>301));
}

//set the location name reg var from the woeid helper
Expand Down Expand Up @@ -138,7 +138,7 @@ public function listallAction()
else {
//dont accept other values than give/want
$this->_helper->_flashMessenger->addMessage($this->view->translate('this url does not exist'));
$this->_redirect('/' . $this->lang . '/ad/listall/ad_type/give');
$this->_redirect('/' . $this->lang . '/ad/listall/ad_type/give', array('code'=>301));
}


Expand Down Expand Up @@ -322,7 +322,7 @@ public function showAction()
$urlChunks = str_replace('.html', '', $urlChunks);
$urlChunks = str_replace('-', ' ', $urlChunks);
//redir to search
$this->_redirect('/' . $this->lang . '/search/?q=' . $urlChunks[sizeof($urlChunks) - 1] . '&ad_type=1&woeid=' . $this->location);
$this->_redirect('/' . $this->lang . '/search/?q=' . $urlChunks[sizeof($urlChunks) - 1] . '&ad_type=1&woeid=' . $this->location , array('code'=>301));
}
}

Expand Down

0 comments on commit e211cee

Please sign in to comment.