Jump to content

Rewrite Url But Keep One Querystring Parameter


themistral

Recommended Posts

Hi guys,

 

I'm working on an old version of osCommerce with a mod that rewrites URLs to SEO friendly ones.

This is not a site I have built and as such am unfamiliar with the mod.

 

.htaccess is setup with the following rewrite rule:

RewriteRule ^(.*).html$ root.php?$1.html&%{QUERY_STRING}

 

This works absolutely fine, except for the fact that when we use this from Adwords, we lose the gclid which means that conversion data is being lost.

 

Is there a way to check for the gclid parameter and parse that as a query string?

 

I was thinking something like

RewriteCond %{QUERY_STRING} (^|&)gclid($|&)
RewriteRule ^(.*).html?{QUERY_STRING}$ root.php?$1.html&%{QUERY_STRING} [QSA]

I've tried this but it's not working.

 

Utlimately want I want to achieve is

page_uri.html?gclid=status

 

Is this even possible, and if so, can someone point me in the right direction?

 

Thanks :happy-04:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.