0

I ran into a dilemma with a website I created with a CMS and PHP. My customer went to an advertising firm and they started doing Goode Adword marketing. They started using the marketing in adds, but when they appended the string provided by Google to the URL of the pages on the website, it blew away my website. The string is provided as follows:

/?keyword=%2Bkuecker%20%2Blogistics&gclid=CIL55sDS9NMCFdC4wAodApULLQ

What I found is that it completely disoriented my path names. I had to go into each link of .css, .js, etc. and make the path relative. I also put the main menu, side menus, footer, header in separate PHP files and pull them into each page. I had to go into each of those and make each link a full path URL.

I got it all working, but, I also use PHP on some of my simple websites. I put the menu, header, footer, etc. in separate files to streamline website updates. The Google Ad string has the same effect on those sites.

So, I'm looking for advice. What do I need to do to avoid this?

http://advantageelectricks.com/projects.php Example page without string.

http://advantageelectricks.com/projects.php/?keyword=%2Bkuecker%20%2Blogistics&gclid=CIL55sDS9NMCFdC4wAodApULLQ Example page with the string.

Thanks in advance.

Community
  • 1
  • 1
Furtig
  • 1
  • 1

1 Answers1

0

To remove the question mark, fiddle a little with your .htaccess.

Try the following:

RewriteEngine On
RewriteBase /
RewriteRule ^(.+)php/$ $1php [R=301,L]

I hope it works!

Julian Koster
  • 262
  • 1
  • 10
  • I tried asking them to do that. I was told that Google formats it that way. The company my customer hired is "supposed" to be experts, and they are not listening to me. Yes, the "/" is the issue; without it, it's not a problem. They insist that Google provides it and they cannot change it. :( – Furtig Jun 16 '17 at 17:35
  • Google; remove trailing slash with htaccess and use the solution – Julian Koster Jun 16 '17 at 17:55
  • https://stackoverflow.com/questions/21417263/htaccess-add-remove-trailing-slash-from-url – Julian Koster Jun 16 '17 at 18:24
  • So, any more regarding my problem? – Furtig Jun 16 '17 at 22:04
  • Did you look into the link I commented? It could possibly remove the '/' before the question mark; it's worth a shot – Julian Koster Jun 16 '17 at 22:30
  • I did, thank you. The problem I have is that this comes straight from Google Ad words, so the "/" is out of my control, and without the slash, the Ad Word link doesn't convert. So, even if I could change the string and remove the slash, they would not get any feedback and could not tell if someone visited the site from the ad. – Furtig Jun 20 '17 at 18:18
  • Is projects.php the only page to which AdWords directs? – Julian Koster Jun 22 '17 at 13:03
  • No. Every page except for the contact forms is subject to the AdWords campaign. – Furtig Jul 07 '17 at 16:02