Welcome Guest, Not a member yet? Register   Sign In
Query String Problem, Can't Resolve with Config Changes
#1

[eluser]blzabub[/eluser]
I've got this problem described here-

http://ellislab.com/forums/viewthread/131060/

Basically, like the original poster, my email service and other places such as google ads and facebook ads are tacking on query strings before referring people to my site.

I've tried this-

Code:
$config['enable_query_strings'] = TRUE;

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

This fails for me, all my URL segments redirect to the homepage instead of to their relevant controllers/methods when the uri protocol is set to PATH_INFO. Perhaps this is because of my hosting company's configs (Site5)? I've tried the other methods: QUERY_STRING, REQUEST_URI, to no avail.

Perhaps my .htaccess file is contributing to the problem?:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

</IfModule>

I've tried adding a query string rewrite such as:

Code:
RewriteCond %{QUERY_STRING} .
RewriteRule (.*) http://www.mysite.com/$1? [R=301,L]

Also doesn't work.

Thanks for any help. I feel like I've read and tried solutions from 30 or 40 separate threads in the forum and none have worked.
#2

[eluser]blzabub[/eluser]
I was actually able to partially solve this problem by adding the following htaccess rules-

Code:
RewriteCond %{QUERY_STRING} ^utm*
RewriteRule ^$ /main? [L]

My email service tacks on query strings that look like this-

mysite.com/?utm_source=foo&utm_campaign=bar

This solution seems to work, however, I'd prefer not to write such a rule for all possible query strings. However, it seems that if I don't have-

^utm*

Apache will redirect even my normal segment URLs like

mysite/main/contact

Thus breaking my site navigation.
#3

[eluser]WanWizard[/eluser]
This has been discussed several times over the last few days.

Have you tried this: http://ellislab.com/forums/viewthread/15...30/#778584
#4

[eluser]blzabub[/eluser]
Thanks, I actually blew past that thread earlier. I went back and re-read it.

I've come up with this solution which seems to work-

Code:
RewriteCond %{QUERY_STRING} .
RewriteRule ^$ /main? [L]

I'm able to do this without modifying uri_protocol or enable_query_strings




Theme © iAndrew 2016 - Forum software by © MyBB