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:

Edited by themistral
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.