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 Like 46 Dislike
Previous forums Next forums
Other forums

PHP doesn't send my mail
Hi all, I found this and used it to send mail. Simple contact form with some required fields. The va

does anyone know a php script to send mail using gmails/googles free smtp server
cause i heard u can do that but i dont know how

my two tables
table1 : col1 = topicid , col2 = topic

table2 : col1 = sentid, col2 = sentence

Cod

How do I send data using an html link
Hi

If I have
<a href="main_file.php">

How do I send data t

Linux socket programming
Where can I find a good introduction to socket programming?

AUTONUMBER PROBLEM
Hello Everyone,

My name is Jones and i am new to this forum and to oracle. I am using ora

ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al

PHP If Else statement for breadcrumb
Hi

I am trying to use a PHP if else statement to display a breadcrumb link on wordpress

Will an XHTML DOCTYPE interfere with my PHP if I'm not experienced enough?
I've read this article here: http://friendlybit.com/html/why-xhtml-is-a-bad-idea/

In a nutshe

Open browser page depending on XML results
Hello,

I have some PHP code that sends webbased from data to an external url ( in the form of

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash