Wednesday 11 April 2012 4:03:39 am - 6 replies
I'm wanting to allow query strings to pass through when redirecting to a custom URL alias - any ideas where the best place to start digging is?
e.g mysite.com/special?utm_source=google&utm_medium=email&utm_content=easter&utm_campaign=myproduct => mysite.com/uk/category/products/special?utm_source=google&utm_medium=email&utm_content=easter&utm_campaign=myproduct
Wednesday 11 April 2012 8:34:25 am
Hi Geoff,
I think its a deprecated method but maybe you could start working on this:
http://projects.ez.no/redirect_operators
i also could imagine, that you could work something out on vhosts in your apache via regex.
Best Chris
Friday 13 April 2012 11:56:44 am
So, after a quick test and check with Eclipse + XDebug, I overrode the default eZHTTPTool class in my extension and added a line to the end of the eZHTTPTool::createRedirectUrl method:
if ( isset($_SERVER[QUERY_STRING]) && $_SERVER[QUERY_STRING] != '' ) $uri .= '?' . $_SERVER[QUERY_STRING];
Hopefully this won't stuff anything up in the process. I'll probably add a setting for turning this off/on in site.ini > HTTPHeaderSettings and add it to the above condition.
Cheers,
Geoff
Modified on Friday 13 April 2012 12:00:16 pm by Geoff Bentley
Monday 16 April 2012 3:39:14 am
Quote from Gaetano Giunta :@Geoff looks interesting enough for a pull request...
I'll get onto it then! ![]()
You must be logged in to post messages in this topic!