Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Removing URL parameter via .htaccess

Hi,

In my Google Analytics incoming reports I have lot of urls with a NOT MINE url parameter added at end that is leading to a page not found error:

For example:
/search/pdf/ejercicios+de+las+7+herramientas+de+calidad?fb_xd_fragment=

When the right URL is /search/pdf/ejercicios+de+las+7+herramientas+de+calidad

As you see the "?fb_xd_fragment=" is added at the end of my URL.

It seems to be a facebook button issue: http://www.google.com/search?q=fb_xd_fragment+fix&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

But what i want is to redirect this:
/search/pdf/ejercicios+de+las+7+herramientas+de+calidad?fb_xd_fragment=

to this: /search/pdf/ejercicios+de+las+7+herramientas+de+calidad

How can I do this from my htaccess ?

Please help!!

thank you
0
Fernanditos
Asked:
Fernanditos
  • 2
1 Solution
 
dsmileCommented:
Try this


RewriteEngine On
RewriteRule ^/search/pdf/ejercicios+de+las+7+herramientas+de+calidad?fb_xd_fragment=  /search/pdf/ejercicios+de+las+7+herramientas+de+calidad? [R=301,L]

Open in new window



or

RewriteEngine On
RewriteCond %{QUERY_STRING} ^fb_xd_fragment=$
RewriteRule ^(.*)$  /search/pdf/ejercicios+de+las+7+herramientas+de+calidad? [R=301,L]

Open in new window

0
 
FernanditosAuthor Commented:
As usual, I was forced to accept a solution. This did not fix my problem because I have lot of URLs with that issue, the idea was to do something without entering individual urls on the .htaccess.
0
 
Ray PaseurCommented:
@fernanditos: You are not forced to close a question if you have outstanding dialog.  You can explain a little more or ask clarifying questions.
0
 
dsmileCommented:
@Fernanditos: just wanna help you out, it's not about points here. I could have helped you better if you had clarified your question since the beginning :)

In your case, try

RewriteEngine On
RewriteCond %{QUERY_STRING} ^fb_xd_fragment=$
RewriteRule ^(.*)$  /$1? [R=301,L]
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now