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

  • Home
  • SEARCH
  • 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 7913015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:44:37+00:00 2026-06-03T13:44:37+00:00

Someone is creating erroneous links by adding a question mark and random characters to

  • 0

Someone is creating erroneous links by adding a question mark and random characters to random pages on my website in the following format:

  • http://www.mydomain.com/?57237933 (only numbers)
  • http://www.mydomain.com/folder1/?709d0c24941 (with letters)
  • http://www.mydomain.com/folder1/page-name/?20?9h572 (double question mark)

I have found a block rule for robots.txt but need a stronger htaccess solution. I am looking for a htaccess rewrite rule that can remove the ? and everything following it from any URLs, redirecting the visitor to the original URL.

I’ve found solutions to remove, for example, ?id=123 but when id= isn’t there I haven’t found a solution.

  • 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-03T13:44:39+00:00Added an answer on June 3, 2026 at 1:44 pm

    The following two rules check for the presence of query string and redirect to the no-query string version of the page:

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

    Since you are worried about search engines crawling wrong version of page, consider changing to R=301 once you’ve tested. Also, you might want to consider returning a 404 error to discourage the use of query strings and tell the search engines that there is no such thing as http://mydomain.com/page/?1234.

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

Sidebar

Related Questions

Can someone assist in creating a Regex for the following situation: I have about
I am creating a website for someone for free (as a favor) however I
I am creating a quick view effect for my website. When someone hovers over
I am creating a badge for my website. UPDATE and CHANGE the question body
Could someone give me a little direction on creating crossfades/dissolves between two UIImageViews in
Can someone please summarize the advantages of creating an Azure WokerRole vs. simply starting
I am creating a landing page for a client where someone enters info, and
Could someone please explain to me how to properly use the Anchors when creating
I'm creating shopping cart and I'm having one problem: When someone orders an item
I hope someone out there can shed some light on the topic of creating

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.