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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:30:40+00:00 2026-05-25T20:30:40+00:00

I cannot wrap my head around URL rewriting. What I want to do seems

  • 0

I cannot wrap my head around URL rewriting. What I want to do seems very simple but I am having problems getting the results I want.

I would like allow users to type www.mysite.com/search/real with an optional / at the end. This would take them to www.mysite.com/content/search_real_property.asp

That’s it. Here is the rule I have right now. The problem with this is it will keep stacking.

RewriteRule ^(search) content/search_real_property.asp

So this would work /search/real but so would search/real/search/real/search/real/
and others.

  • 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-25T20:30:41+00:00Added an answer on May 25, 2026 at 8:30 pm

    Assuming there are no other issues, you’ve turned the rewrite engine on (RewriteEngine On) and that you’re either adding the rewrite in httpd-vhosts.conf or an .htaccess file in the root of the web tree (so that any path issues are resolved)… then the issue is merely one of Regular Expression pattern matching. Though I’m a bit perplexed by ASP running on what appears to be an Apache server (assuming this IS mod rewrite we’re talking about).

    So, all you really want is to terminate the match – something like:

    RewriteEngine On
    RewriteRule ^search/real/?$ /content/search_real_property.asp
    

    That will fix it to /search/real (with or without a trailing slash, the ? means match the preceding character 0 or 1 times) to /content/search_real_property.asp. As the $ sign denotes the line terminator (EOL effectively) there must be nothing after “real” (except perhaps that 1 forward slash).

    For greater flexibility you might want to look at what you can actually do with regular expressions, for instance…

    RewriteEngine On
    RewriteRule ^search/([^/]*)/?$ /content/search_real_property.asp?query=$1
    

    Which would allow you to take any string and pass it in the address bar as a variable called query (Request.QueryString(‘query’) IIRC).

    Try: http://www.regular-expressions.info/ for more info.

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

Sidebar

Related Questions

I love CakePHP, but cannot wrap my head around the ACL/Auth subject. Everything else
this is probably very simple using javascript or jquery, but I cannot wrap my
I have a database issue that i currently cannot wrap my head around with
I have a very simple C# DataTable problem that I cannot seem to wrap
I'm trying to wrap my head around NSNotification but can't seem to get it
I have a rails question that I cannot seem to wrap my head around.
I've been trying to wrap my head around routing and for that very reason
I cannot wrap my head around this...I have an array that looks like: Array
I'm trying to wrap my head around linq -> nhib I have a simple
I simply cannot wrap my head around how to solve this problem and after

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.