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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:53:44+00:00 2026-05-13T15:53:44+00:00

I am redirecting all requests like so: RewriteRule ^sitemap.xml$ sitemap.php?/ [QSA,L] # the line

  • 0

I am redirecting all requests like so:

RewriteRule ^sitemap.xml$ sitemap.php?/ [QSA,L]

# the line below is the one I'm having trouble with

RewriteCond %{REQUEST_URI}  !^market-reports$ 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php?section=$1 [QSA,L]

All my incoming links are meant to go to index.php, as you can see. But now I want to stop one from going there. I’ve never written my own RewriteCond before, so I’m a little unsure if what I am doing is correct.

Basically what I’m trying to say is: “If incoming URL is a file, directory or /market-reports/ do nothing. Otherwise send on the URL to index.php?section=”

What am I doing wrong? Thanks

  • 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-05-13T15:53:45+00:00Added an answer on May 13, 2026 at 3:53 pm

    So you just need to ignore http://yourdomain.com/market-reports (in addition to files/directories?). You should be fine with:

    RewriteCond %{REQUEST_URI} !^/market-reports/?$
    

    This will (not) match “http://yourdomain.com/market-reports” as well as “http://yourdomain.com/market-reports/” as the question mark “?”, in the Perl Compatible Regular Expression vocabulary that mod_rewrite uses, makes the match optional (a wildcard) before the end of the string anchor, which is represented with the literal dollar sign “$”.

    The “^” symbol acts as an anchor matching the beginning of the string and the “!” negates the match, so that any string URL that does not match the rest of the expression will be rewritten to the other specified rules.
    See mod_rewrite regex vocabulary

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

Sidebar

Related Questions

I'm redirecting all requests to index.php, which parses the URL and fires the appropriate
I'm trying to internally redirect all requests to index.php and externally redirect all requests
I would like mod_rewrite to redirect all requests to non existing files and folders,
We all know that wordpress have simple .htaccess code like below RewriteEngine on RewriteBase
Lets say I have a site that has one page that handles all requests
The server in some ways redirecting all the request into its mobile version, in
I'm having hard time getting my head wrapped around this one - and it
How can I redirect all requests going to web root to another folder (e.g.
I have a website where all requests are redirected silently (via .htaccess ) to
Branching off of questions like this one , I'm looking to wrap jQuery's $.ajax()

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.