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
Did you know?Explore Trending and Topic pages for more stories like this.
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
Agency Business Process
Hi,
I don’t understand the process of the agency business in SAP.
In my
Where do I put CRON code
So I've figured out alot about how to automatically run a php function. I can't figure out where to
captcha error
I have been trying to implement a captcha in php...
here is the code..
Code: (php) [Select
simplexml and xpath - Need some help
Hello,
I am trying to parse an xml which comes back from Amazon and I am trying to know how m
Table sorting
Hi,
I'm trying to modify the following in order to make the output table sorted alphabeticall
How could I combine these arrays??
Hello.. I'm trying to figure out a way to combine these first two arrays to get the last array..
php multiple action on submit
I have a form which says:
<form enctype='multipart/form-data' method='post' action='pr
Displaying Multidimensional Arrays...about to put my head in a vice, PLEASE HELP
I am fairly new to PHP and MySQL and I have a problem which I have been trying to resolve for days.
SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built
update the selected existing records of database
Hi frndz,
I am new to php and get stuck....
Edit.php > Update.php > Updatea