URL Rewrite issue
Posted on
16th Feb 2014 07:03 pm by
admin
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But now that i am buying in traffic through Adwords the gclid parameter is being dropped and im unable to measure conversions...im not sure if its the php or the rewrite rule at fault...the rewrite rule im assuming. Im not sure if the ? is saying keep parameters or not.
Code: # page rewrite rule example http://www.mydomain.co.uk/location/1/name/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^location/([^/]+)/([^/]+)/? location-view.php?loc=$1&n=$2 [L,NC]
and on the page in question "location-view.php" i have the following:
Code: if (isset($_GET['gclid'])){
if ($_SERVER['REQUEST_URI'] != "/location/".$row_getlocation['location_id']."/".$row_getlocation['location_seo_name']."/?gclid=".$_GET['gclid']) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: /location/".$row_getlocation['location_id']."/".$row_getlocation['location_seo_name']."/?gclid=".$_GET['gclid']);
exit;
}
}else if (!isset($_GET['gclid'])) {
if($_SERVER['REQUEST_URI'] != "/location/".$row_getlocation['location_id']."/".$row_getlocation['location_seo_name']."/") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: /location/".$row_getlocation['location_id']."/".$row_getlocation['location_seo_name']."/");
exit;
}
}
thanks
No comments posted yet
Your Answer:
Login to answer
213 46
Other forums
i need help with php header and footer
I have designed a header and footer for my site and they seem to be ok when they are running individ
Sending a hyperlink through mail
HI all,
I am sending a mail to outlook mailbox of a user using FM SO_NEW_DOCUMENT_ATT_S
Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site
check how many commas the variable containing the query has between [i]select[/i
Hi...
iv made an sql table that contains id number - name of sql query and an sql query.
T
Stumped by Third Day of Month problem
I am trying to build an algorithm that will essentially do this:
Code: [Select]$this_month = Oct
Help With editting and deleting form
Hallo !!
So look at this image :
http://img194.imageshack.us/img194/8272/snapshot5f.pn
Transferring session variables into MySQL
I am trying to transfer $_SESSION variables into MySQL. However there is an error in my MySQL statem
Can I call a class inside a function?
I have a class written in another file that handles my image resizing.
Can I do this (php say
I didnt code this but I need help with it
I'm sorry. i'm not a coder. I have this script for forcing download and previewing mp3. The guy that
News script
Hi ...
I am not sure if this is the rite place to post this but if its not sorry
i am