Welcome Guest, Not a member yet? Register   Sign In
Google Analytics & Codeigniter
#11

[eluser]scubasean[/eluser]
Hi Randy,

I really appreciate your reply and help! Here is my config information:

mod_rewrite/apache version : 2.0.52

htaccess content :

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on

RewriteCond %{SERVER_PORT} 80
RewriteCond $1 ^(contactus|contactus/submit|backend)
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L]

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/?$1 [L]
</IfModule>

$config['uri_protocol'] = "AUTO";
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_?&=-';

$route['default_controller'] = "home";
$route['scaffolding_trigger'] = "";

We know the uri_protocol is not correct but when we switch it to path_info we loose our ability to navigate the site...

Many many thanks for your help and I look forward to your suggestions,

Sean
#12

[eluser]Randy Casburn[/eluser]
[quote author="scubasean" date="1223566088"]
$config['uri_protocol'] = "AUTO";

We know the uri_protocol is not correct but when we switch it to path_info we loose our ability to navigate the site...
[/quote]

Sean,

You can't have it both ways. Are you saying that you are trading problems?

1) your query string problem goes away when the uri_protocol is set to path_info but you can't navigate

2) you can navigate with uri_protocol set to AUTO but your query strings are broken

It sounds like you'll need to do the hard work of refactoring your navigation code that breaks if this is the case.

I'm confused now.

Randy
#13

[eluser]Pascal Kriete[/eluser]
I disagree with Randy :lol: . I think all you need is one less question mark in your htaccess:
Code:
RewriteRule ^(.*)$ index.php/$1 [L]
#14

[eluser]Randy Casburn[/eluser]
@inparo - it won't work. :cheese:

@Sean - let us know.

Randy
#15

[eluser]scubasean[/eluser]
Hi Randy,

You definitely hit the nail on the head there. Could you possibly give us some pointers on refactoring the navigation code to when using path_info? Maybe some sample code?

Thank you for helping!

Sean

[quote author="Randy Casburn" date="1223578858"][quote author="scubasean" date="1223566088"]
$config['uri_protocol'] = "AUTO";

We know the uri_protocol is not correct but when we switch it to path_info we loose our ability to navigate the site...
[/quote]

Sean,

You can't have it both ways. Are you saying that you are trading problems?

1) your query string problem goes away when the uri_protocol is set to path_info but you can't navigate

2) you can navigate with uri_protocol set to AUTO but your query strings are broken

It sounds like you'll need to do the hard work of refactoring your navigation code that breaks if this is the case.

I'm confused now.

Randy[/quote]
#16

[eluser]scubasean[/eluser]
We changed all the configuration parameters as specified in the thread and we lost all the navigation (the homepage would show, but no links). I searched the net and found this page about a potential problem with the path_info variable on the server and a work around here:

http://www.terencechang.com/2008/08/28/c...-apache-2/


I added cgi.fix_pathinfo = 0; to my php.ini file and now the site links work, even with the ? mark, but the homepage is CI 404ing now.. Any idea how to get the homepage url to work ideally with the google code?

Thanks again!

Sean
#17

[eluser]scubasean[/eluser]
I tried removing the ? from the .htaccess with no luck. Thanks for the suggestion!

[quote author="inparo" date="1223584083"]I disagree with Randy :lol: . I think all you need is one less question mark in your htaccess:
Code:
RewriteRule ^(.*)$ index.php/$1 [L]
[/quote]
#18

[eluser]Randy Casburn[/eluser]
OK...great news then.

Let's make sure I understand this.

The ONLY problem you have remaining is that you require Google ad words on your home page, so the Google script is adding the infamous junk onto the url for your home page and that page is not working.

With query strings turned on, I think this could be a simple matter of modifying your .htaccess file to include the query string prefix letter for your controller (?c=). I'm thinking if you add it and leave it blank it will force the default controller.

Code:
RewriteEngine on  

  RewriteCond %{SERVER_PORT} 80
  RewriteCond $1 ^(contactus|contactus/submit|backend)
  RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L]

  RewriteBase /

  RewriteCond (https://www.mysite.com|https://www.mysite.com/index.php)
  RewriteRule ^(.*)$ index.php/?c= [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d

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

I don't know if these are still your cond/rule sets or not, but note the addition. If the root url is requested specifically, let's tag on the blank controller query string indicator.

You'll need to ensure these are set properly in the config.php config file.

I'm not sure this will work. Give it a shot.

Randy
#19

[eluser]scubasean[/eluser]
We are getting errors from this rule:

RewriteCond (http://mysite.com|http://mysite.com/index.php)
RewriteRule ^(.*)$ index.php/?c= [L]

Error 500:

[Tue Oct 14 04:42:41 2008] [alert] [client 222.222.222.222] /home/virtual/site100/fst/var/subdomain/mysite/html/.htaccess: RewriteCond: bad argument line '(http://mysite.com|http://mysite.comt/index.php)'

Also the root of our site is 404ing without any google additional info... but the sub pages are working with and without the google additional info...

Any ideas?

Thanks,

Sean
#20

[eluser]supahero[/eluser]
I try to modify the error_404.php. So when it's 404, it'll call load->view() function. but it seem CI can't do this.
btw, here's the thread about load->view on error_404.php : http://ellislab.com/forums/viewthread/87398/




Theme © iAndrew 2016 - Forum software by © MyBB