ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Question mark in url causes a 404

November 06, 2012 8:01am

Subscribe [3]
  • #1 / Nov 06, 2012 8:01am

    11Media

    157 posts

    Hi,

    Quite a common request is tracking page sources by adding ?utm_ or or somethign similar to urls to track specific sources e.g. newsletters, banners etc - but adding a ?some_query_here - to my Ee urls is causing 404’s e.g. it thinks it’s part of the URl.

    So my setup is, i’m using .htaccess to remove index.php from the url.

    so I have clean urls like this: 

    mysite.com/segmentonehere/this-is-a-url-title

    but if I do something like this

    mysite.com/segmentonehere/this-is-a-url-title?utm_tracking

    Then it just spits out a blank 404 page… Any ideas how to get EE to play nicely with tracking or anything with a ? on the end?

    EE 2

    Cheers,

  • #2 / Nov 07, 2012 11:53am

    Rob Allen

    3108 posts

    It’s probably seeing the string as part of the segment, have you tried adding a slash?

    mysite.com/segmentonehere/this-is-a-url-title/?utm_tracking

  • #3 / Nov 07, 2012 12:03pm

    Shane Eckert

    7174 posts

    Hey 11Media,

    Thank you for posting your question.

    Rob is right, I think the ? is making the string appear as part of the segment. What happens when you add the trailing slash?

    Cheers,

  • #4 / Nov 09, 2012 6:58am

    11Media

    157 posts

    Hi guys,

    Thanks for your responses.


    I’ve tried the trailing slash but still get errors….. it seems to be happening on other links as well on the same site e.g. the root…


    mysite.com/?utm_  

    mysite.com/segment1/?utm


    Very weird indeed, is there any info you need to help me out here please?

  • #5 / Nov 09, 2012 7:39am

    11Media

    157 posts

    Update:

    I’ve disabled strict urls…

    And it’s making some progress, but it’s not perfect e.g.

    It will now render “?” in the url e.g..

    <a href="http://www.mysite.com/segment1/url-title-here">http://www.mysite.com/segment1/url-title-here</a>?

    But if you add anything after the url it just takes you back to the index…

    e.g. this won’t work…

    <a href="http://www.mysite.com/segment1/url-title-here?utm_">http://www.mysite.com/segment1/url-title-here?utm_</a>


    Hope someone can help

  • #6 / Nov 12, 2012 1:01pm

    Shane Eckert

    7174 posts

    Hey there 11Media,

    Can you show me the contents of your htacess?

    Thank you,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases