Welcome Guest, Not a member yet? Register   Sign In
Random ? [question mark] appearing in urls
#1

[eluser]darrenfauth[/eluser]
After upgrading from 1.7.2 to 2.1.2 I am experiencing an issue I don't know how to debug. Clicking on a url (in an email or search results) pointing to an internal page on my site sometimes results in a ? being inserted in the url after the domain and before the url parameters. It is not present in the link clicked but resolves that way and is present in the address bar once arriving at the site.
Code:
http://mydomain.com/parameter/parameter
becomes
Code:
http://mydomain.com/?/parameter/parameter

The result is landing on the home page rather then the intended page.

The relevant (I think) settings in my config.php are:

Code:
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['allow_get_array']  = TRUE;
$config['enable_query_strings'] = TRUE;

My .htaccess file:

Code:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com
RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L]

Anybody have any thoughts?

Thanks!
#2

[eluser]darrenfauth[/eluser]
I think I may have this fixed. The ? is no longer being inserted in the url. I remember trying variations of this solution in the past but forget why I settled on the one I did.

I found this write up on CI 2 and friendly urls: http://taggedzi.com/articles/display/cod...endly-urls

I changed my config.php...
Code:
$config['uri_protocol'] = 'AUTO';
to
Code:
$config['uri_protocol'] = 'REQUEST_URI';

Links in emails and search results resolve correctly. I'll have to see if any of the ajax calls, etc are affected. Fingers crossed.




Theme © iAndrew 2016 - Forum software by © MyBB