Welcome Guest, Not a member yet? Register   Sign In
Google ads + .htaccess + CI routing = 400 Bad Request
#1

[eluser]gautaml[/eluser]
I have a site that is very close to going live but I am having trouble embedding Googleads in the page.

The ad doesn't show up and Chrome debug shows this:
Image: Google Chrome debug

I put the ad script on a page on its own (not CI tied) and it shows up fine so I don't suspect it's the .htaccess but something with routing.

I have gone through several forum posts mostly those involving changing the config's uri_protocol (PATHINFO, etc) and enable_query_strings.

Treid all sorts of combos but nothing works.

Code:
$config['base_url']               = 'http://'.$_SERVER['HTTP_HOST'].'/';
$config['index_page']             = 'index.php';
$config['uri_protocol']           = 'REQUEST_URI';
$config['url_suffix']             = '';
$config['permitted_uri_chars']    = 'a-z 0-9~%.:_\-+@?=&';
$config['allow_get_array']        = TRUE;
$config['enable_query_strings']   = TRUE;

Here's my .htaccess
Code:
Header unset ETag
FileETag None

ExpiresActive On
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|css|js)$">
    ExpiresDefault "access plus 1 years"
</FilesMatch>

# Compress assets
<ifmodule mod_deflate.c="">
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

# Rewrite root
RewriteEngine On
RewriteBase /

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond $1 !^(index\.php)

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

And here's (some of) my routes.php

Code:
$route['default_controller']        = 'somepage';
$route['404_override']              = '';
$route['blog|/blog/(:any)']         = 'home/blog';
$route[':any']                      = 'somepage/catchall';

Any help?


Messages In This Thread
Google ads + .htaccess + CI routing = 400 Bad Request - by El Forum - 06-29-2011, 06:48 PM
Google ads + .htaccess + CI routing = 400 Bad Request - by El Forum - 06-29-2011, 07:29 PM
Google ads + .htaccess + CI routing = 400 Bad Request - by El Forum - 06-29-2011, 07:51 PM
Google ads + .htaccess + CI routing = 400 Bad Request - by El Forum - 06-29-2011, 08:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB