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.

Pages Module and URL parameters

January 14, 2011 10:17am

Subscribe [4]
  • #1 / Jan 14, 2011 10:17am

    Fuel

    44 posts

    On the sites that we build, there’s a certain number of url parameters that we look for via an .htaccess file. For example, Google Analytics tracking parameters may look something like this : http://domain.com/?cmpid=12345

    Generally we do not have any issues with these, but we are with URIs created with the Pages module. Is there any way for a URI created with the Pages module, with attached URL parameters (ex. http://domain.com/about/?cmpid=12345 ) to ever work properly? Has anyone seen any tutorials or posts that may have a potential workaround?

    This is for EE2 by the way, but could apply to both EE1 and EE2 I assume.

    Thanks

  • #2 / Jan 14, 2011 5:03pm

    Sue Crocker

    26054 posts

    What happens when you try and create a URL like that using the Pages module?

    Can you tell us which version/build of EE2.x you’re using? See EEWiki:// HowTo Determine My EE Version

  • #3 / Jan 14, 2011 5:33pm

    Fuel

    44 posts

    Hi Sue, Thanks for taking a look at this issue.

    I’m not really looking to create a URI with the parameters in it. I want to make sure that any page created via the Pages Module can render properly with tracking parameters attached to it. In other words, there could be multiple variations of these parameters.

    I did a little further testing with a few other sites, both EE1 and EE2 at different versions.
    - All of the EE1 (versions 1.6.7 and 1.6.8) sites seem to handle this without issue.
    - All of the EE2 sites (versions 2.1.0 and 2.1.1) that I’ve tested produce a 404.

    I will upgrade a site to 2.1.3, test it and report back as soon as I can.

    Thanks

  • #4 / Jan 14, 2011 6:20pm

    Fuel

    44 posts

    I have tested a 2.1.3 site and the result is the same. Always a 404 error.

    Thanks

  • #5 / Jan 15, 2011 3:06pm

    Greg Salt

    3988 posts

    Hi Fuel,

    Can you clarify what it is that you are doing in the .htaccess file for these URIs?

    Cheers

    Greg

  • #6 / Jan 16, 2011 12:50pm

    Fuel

    44 posts

    Hi Greg,

    We’re using the NSM htaccess generator add-on to remove index.php. So we have a few rules to overcome some issues where tracking parameters get lost or send users to 404 pages.

    #Rewrite homepage urls that have the cmpid query string
    RewriteCond %{QUERY_STRING} ^cmpid [OR]
    RewriteCond %{QUERY_STRING} ^test [OR]
    RewriteCond %{QUERY_STRING} ^utm_(.*) [OR]
    RewriteCond %{QUERY_STRING} ^showdebug [OR]
    RewriteCond %{QUERY_STRING} ^tollfree
    RewriteCond %{REQUEST_URI} ^/$ [NC]
    RewriteRule (.*) /index.php?/site/index/&%{QUERY_STRING} [L]
  • #7 / Jan 17, 2011 2:10am

    John Henry Donovan

    12339 posts

    Fuel,

    Make sure in your config.php file that you have changed

    $config['uri_protocol']    = 'AUTO';

    to

    $config['uri_protocol']    = 'PATH_INFO';

    For us to troubleshoot this for you you will need to disable the htaccess and reinstate the index.php as we don’t support he removal of it

    What’s in your channel entry tag for that single entry page? Specifically parameters

    Can you use a query string on a non Pages URL without issue?

  • #8 / Jan 17, 2011 1:45pm

    Fuel

    44 posts

    A quick test of using PATH_INFO vs. AUTO caused issues.

    I am currently removing all add-ons and will test and report back again after that.

    We use EngineHosting, if that info is valuable.

    With a fresh installation of 2.1.3, is this something that normally works without issue by default? I will find out soon enough, I just thought I would ask.

    Thanks!

  • #9 / Jan 17, 2011 4:38pm

    Fuel

    44 posts

    I have now have a clean installation of 2.1.3 with zero add-ons and am having the same issue while the “uri_protocol” is set to “AUTO”

    Works: http://domain.com/index.php/test-page/
    404: http://domain.com/index.php/test-page/?test=123

    BUT, with the “uri_protocol” is set to “PATH_INFO” it is working correctly. So that means I have some testing to do with the add-ons that I generally use. My hunch is that NSM .htaccess generator is the culprit, but it’s a necessity so I will find a way to make it work regardless.

    I will do my homework on the “uri_protocol” config variable. That’s new to me. Any insight you can share would be helpful, as I prefer not to deviate from defaults unless it’s absolutely required.

    So, now the question is ... Since AUTO is the default setting, are there any known potential issues, hurdles or gotchas with using PATH_INFO? Again, we only use EngineHosting if that information is helpful.

    Thanks

  • #10 / Jan 18, 2011 7:58am

    Sue Crocker

    26054 posts

    Ordinarily you wouldn’t need to use PATH_INFO, but what this means is that instead of having index.php in your urls, you’d use index.php?. That’s the only potential gotcha.

    You’ll need to fiddle with your .htaccess on your own. We don’t provide direct support for removing index.php or index.php? using .htaccess.

    Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases