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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:33:23+00:00 2026-05-30T08:33:23+00:00

In the following code, what does the regex do? RewriteCond %{REQUEST_URI} ^/(?:[A-Za-z]+(?:/[A-Za-z]*)*)(?:/\d+)?$ RewriteRule .*

  • 0

In the following code, what does the regex do?

RewriteCond   %{REQUEST_URI}       ^/(?:[A-Za-z]+(?:/[A-Za-z]*)*)(?:/\d+)?$
RewriteRule   .*                   var/www/%1/index.php [L]

What is the outcome of the re-wrtie rule?

Thanks, I am helping a friend fix an old CMS and I don’t know why whomever made it did this.

  • 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-30T08:33:24+00:00Added an answer on May 30, 2026 at 8:33 am

    What is the outcome of the re-write rule?

    AFAIK it will generate 404s when you don’t expect it to. Why?

    1. The (?: something) brackets are basically the same as () except that they don’t set a match variable. Since all bracketing is like this %1 will never be defined.

    2. Picking up Alexander’s description /letters{/letters}([/digits]) where the /digits are optional. The repeat group is “zero or more letters” and hence will eat any / characters, and these are greedy matches, so /aa/bb/cc/123 will be parsed as (/aa)(/bb)(/cc)(/)(123). This will fail since 123 does not match (?:/\d+)?

    3. So it will only match alpha path strings, e.g. /aaa/bbb/ccc and %1 will be “” and in these circumstances this will redirect to var/www//index.php relative to the current path, which will probably be the DOCROOT, so unless DOCROOT/var/www/index.php exists, this will result in a 404.

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

Sidebar

Related Questions

The following code does not submit the input values: $('.button').live('click', function() { var date
The following code opens a text file does a little regex to match names
OK So I'm looking to redirect the following: http://www.example.org/tag/code To the following: http://www.example.org/tag.php?tag=code The
Does anyone have any idea why the following code would output no match? boost::regex
I have a PHP preg_match_all and REGEX question. I have the following code: <?php
The following code does not want to compile. See the included error message. Code:
The following code does not run as rootNode is null when retrieved by name
The following code does not set the comment: string userName = yrtre.etre.423369a9-3e57-42da-934d-dae91f87a1e4; MembershipUser user
The following code does not compile, saying error C2248: 'A::getMe' : cannot access private
The following code does not give a warning with g++ 4.1.1 and -Wall .

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.