[TYPO3-mvc] redirect results in quite ugly url

Franz Koch typo3.RemoveForMessage at elements-net.de
Tue Feb 1 14:10:28 CET 2011


Hey guys,

> perhaps it's a solution to use forward instead of redirect? It has the
> same signature as redirect and should do the job. That prevents Extbase
> from encoding all your information into URL as it is still present in
> the controller context.

yes, use "forward" instead of "redirect". A redirect will send a 
location header to a new URI, whereas a forward is only forwarding the 
request to another controller/action internally (URL is not changing). 
So forward is most likely what you're looking for. Forward also has the 
benefit that you don't have to mess with the request arguments, those 
are automatically passed to the forwarded action.

Example:

public function proxyAction($someFlag) {
	if ($someFlag === 'save') {
		$this->forward('save');
	} else {
		$this->forward('whatever');
	}
}

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list