2

I manage a site for a local live-performance theatre that uses ExpressionEngine to manage their content and TicketMaster for it's online ticket sales.

When a user buys a ticket through TM, they send out a receipt with links back to the theatre's website. Unfortunately, the links are appended with a url query string—specifically ?camefrom=ticketmaster.

Unfortunately, this url causes a 404 Not Found error because EE is trying to parse the get variable as a slug, controller, or page. There is no flexibility on TM's part to create different URLs because it's all automated.

The information I've found thus far concludes that EE doesn't like URL variables at all. Is there any way to circumvent the URL rewrite engine while stile passing this variable to the server (because they'd also like to keep track of the referrals from TicketMaster via an email).

Adding a second parameter (ie, ?camefrom=tm&foo=bar) works, but isn't an option because TM will not change the URL they place in the emails.

Does anyone have an idea?

  • We use query strings in URLs with EE without issue. Can you give some information about your server setup and .htaccess contents? Are you removing index.php from the URL? – Erik Reagan Feb 26 '13 at 23:57
  • What version of EE is this? – UltraBob Feb 27 '13 at 1:04
  • Older EE versions did have issues with GET variables, but this was fixed somewhere around 2.4 from memory. If GET variables still aren't working on the latest version, usually messing with the $config['uri_protocol'] setting in config.php will fix it. Also as Erik mentioned, if you have some crazy htaccess rules you may be breaking your own query string. For best results, always use the official htaccess method. – Adrian Macneil Feb 27 '13 at 14:42
  • Hey guys. Thanks for the responses. The EE version is 2.3 :[ —I'll definitely poke around in the config and do some research. Here's what the htaccess looks like (I am not responsible for this. It's clearly got some wonky workarounds for the way someone designed the template group organization): – user1070 Feb 28 '13 at 15:12
  • RewriteCond %{QUERY_STRING} !^(ACT=.*)$ [NC] RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^/(includes|site|about|shows|tickets|support|education|2011-shows|2012-shows|stage-notes|2013-shows|members|P[0-9]{2,8}) [NC] RewriteRule (.*) /index.php?/$1 [L] – user1070 Feb 28 '13 at 15:13
1

In the past I've always used:

# Catch any Google campaigns directed to the home page
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^(utm_.*)
RewriteRule ^(.*)$ /index.php/ [L,PT]

:)

| improve this answer | |
  • I think RewriteRule ^(.*)$ /index.php/$1 [L] only does the trick, the slash does all the magic. – Reinos Mar 20 '13 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.