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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:05:51+00:00 2026-05-14T00:05:51+00:00

I am currently rewriting a URL, however my RegEx expression is catching a directory

  • 0

I am currently rewriting a URL, however my RegEx expression is catching a directory I want to be ignored.

The rewrite rule is

^people/([A-Za-z0-9\-\_]+)/?$

…Which catches everything that matches. However, I would like to exclude a directory, People_Search, so for instance…

/people/John_Smith

…will forward, but

/people/People_Search

…should not suppose to be.

That’s the only term I want to look for, so if it exists anywhere in the string, I want to ignore it.

Any ideas?

  • 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-14T00:05:51+00:00Added an answer on May 14, 2026 at 12:05 am

    Regex has a thing called a “non capturing negative lookahead assertion” which basically says “don’t match the following”. It looks like this:

    ^people/(?!People_Search)([A-Za-z0-9\-\_]+)/?$ 
    

    Whether you can use this depends on the rewrite engine you use, and the level of regex support that’s included in it. I’d expect that most common rewriters support this.

    FYI: There are also negative lookbehind assertions(?<!), and also postive versions of the lookahead (?=) and lookbehind (?<=) assertions.

    Tutorial: http://www.regular-expressions.info/lookaround.html

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

Sidebar

Related Questions

I am updating a php app, which currently does not use url rewriting. The
I'm using Intelligencia url rewriting currently but have just leased an IIS 7.5 server
I have a complex URL rewriting scheme which breaks the built in Forms Authentication
I'm currently looking into url-rewriting and how it should be done right and hope
I am looking in to implementing Url rewriting for our site, using the rewrite
I am trying to use url rewriting on my website and I want to
I've been having an issue with URL Rewriting and Postbacks. Edit: Currently using IIS
I'm currently using URL Rewriting, but I recently stumbled upon this link on Rerouting
I am using IIS7 URL rewriting with my website which is written in ASP.NET.
I'm currently rewriting a free educational digital circuit simulator to add inertiality to its

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.