Got a site that want to use tracking in URLS like http://domain.com/segment_1/segment_2/?utm_campaign=google

Now this works fine locally but on the production server, it renders the 404.

On MAMP I've set the config['uri_protocol'] = 'PATH_INFO' and have tried this in production but still get the problem.

Any suggestions?


1 Answer 1

RewriteRule ^(.*)$ /index.php?/$1

Instead of...

RewriteRule ^(.*)$ /index.php/$1

Normally the first thing I try when query strings go wrong!

  • seems I jumped the gun a little bit here. Although it fixed the query string problem, it introduced a bug where a single entry view wasn't displaying the right content. For example pilot.no/aktiviteter/detaljer/opptaksprver-stavanger-03.10 would wrongly show location as Stockholm Commented Oct 3, 2013 at 9:57
  • Why/how would the htaccess rewrites impact on the geographical location? It shows Stavanger for me...? Commented Oct 3, 2013 at 13:13
  • yeah, had to revert it back for the client so in production it's fine. Here's the staging link d.pr/f8ob - click on Stavanger and you'll see Commented Oct 3, 2013 at 14:56
  • Sorry, thought I'd commented on this already. Hamar works fine, so I'm not sure this is an htaccess issue - why would it work fine for one and not the others. You'll need to explain how your getting the location, currently in the source I see "stockholm" being sent to Google Maps, so there has to be an issue in your template code, as the displayed data shows the correct location...? Commented Oct 4, 2013 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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