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 8437705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:30:29+00:00 2026-06-10T07:30:29+00:00

I recently had an RFI attack where the query string had a bunch of

  • 0

I recently had an RFI attack where the query string had a bunch of ../../../ and I’d like to modify .htaccess to prevent any ../ in the query string.

I was trying this until I realized the period needed to be escaped:

RewriteCond %{QUERY_STRING} ../
RewriteRule .* - [F]

I then changed it to:

RewriteCond %{QUERY_STRING} \.\./
RewriteRule .* - [F]

But it still forbids any / in the query string.

Also, If I have the rule in {REQUEST_URI} would that make the {QUERY_STRING} redundant?

Thanks.

EDIT:

I have had success getting this to work by:

RewriteCond %{QUERY_STRING} (\.\./)

However, RewriteCond %{REQUEST_URI} \.\./ or RewriteCond %{REQUEST_URI} (\.\./) does not. I’ve also tried /\.\./ & (/\.\./)

  • 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-10T07:30:31+00:00Added an answer on June 10, 2026 at 7:30 am

    The %{QUERY_STRING} is everything after the ?, so your rules successfully block a URL like htis:

    http://domain.com/blah.php?../../../path
    

    But your URI won’t be checked. You can check against both by amending your rule:

    RewriteCond %{QUERY_STRING} \.\./ [OR]
    RewriteCond %{REQUEST_URI} \.\./ 
    RewriteRule .* - [F]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently had a similar thread about this, but now I need to animate
I recently had my free application published in Mac Appstore. I'm trying to find
I recently had an idea to create my own String class to make using
I recently had this problem on a test: given a set of points m
I recently had this question in an interview and this is what I came
I recently had this issue with a client. The code read: ini_set( sendmail_from, noreply@<current-domain>.com
I recently had to implement a small check for any variables that might have
I recently had to take a quick look at Adobe InDesign server. In this
I recently had to perform some string replacements in .net and found myself developing
I recently had this problem about scrolling and focus changing. I solved it by

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.