Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8514987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:01:04+00:00 2026-06-11T05:01:04+00:00

I want to get rid of some query string on my whole website (explicitly

  • 0

I want to get rid of some query string on my whole website (explicitly facebook shared/like query which usually begin with fb_action).

I thought about using .htaccess to do that.

I want this:
Link 1)

http://example.com/documents/de_desmarais_en_sirois?fb_action_ids=10151430962018298&fb_action_types=og.likes&fb_source=timeline_og&action_object_map={%2210151430962018298%22%3A157643874359578}&action_type_map={%2210151430962018298%22%3A%22og.likes%22}&action_ref_map=[]

to look like:
Link 2)

http://example.com/documents/de_desmarais_en_sirois

In my .htaccess, I added:

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

But, when I go on the original link, I am directed to my root folder example.com/pages.php, but I want to keep the first part of the URL which is example.com/documents/de_desmarais_en_sirois. I don’t want to go to my root.

What should I modify/do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:01:05+00:00Added an answer on June 11, 2026 at 5:01 am

    I assume you’ve added those rules to the htaccess file in the /documents/ directory?

    You’ll need to remove the leading slash in your rule’s target and add a rewrite base:

    RewriteBase /documents/
    
    RewriteCond %{QUERY_STRING} fb_action
    RewriteRule ^(.*) $1? [R=301,L]
    

    The query string match could be improved a bit though:

    RewriteCond %{QUERY_STRING} (.*)(^|&)fb_[^&]+(.*)$
    RewriteRule ^(.*) $1?%1%2 [R=301,L]
    RewriteCond %{QUERY_STRING} (.*)(^|&)action_[^&]+(.*)$
    RewriteRule ^(.*) $1?%1%2 [R=301,L]
    

    To remove only the facebook query string parameters, if you have other parameters that you want to preserve.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So my string is something like BlaBlaBlaDDDaaa2aaa345 I want to get rid of its
I want to get rid of the timestamp in this returned string. I am
For some reason, I have following situation: Now I want to get rid of
I am trying to get rid of some references by using string representation of
I have some code repetition that I really want to get rid of -
What solutions,patterns usually used for this? I want to get rid of if/else statements
I have some frames in my presentation, where I want to get rid of
Following the answer from a previous question I want to get rid of some
I want to get rid of you tube play button you see on image,
Say you just want to get rid of the changes you've made to one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.