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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:39:20+00:00 2026-05-31T22:39:20+00:00

I have example.org and foo.example.org pointing to the same directory, /var/www/html/ , and want

  • 0

I have example.org and foo.example.org pointing to the same directory, /var/www/html/, and want foo.example.org to internally redirect to /var/www/foo/ using only mod_rewrite.

This is what I have so far, but no joy:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^foo [NC]
    RewriteRule ^(.*)$ ../foo/$1 [L]
</IfModule>

This gets me 500s due to hitting the limit of 10 internal redirects, but I don’t understand why.

  • 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-31T22:39:21+00:00Added an answer on May 31, 2026 at 10:39 pm

    The reason for the internal redirect loop is that your only RewriteCond is the host name check. The host name won’t change after the internal redirect, and alas, will get triggered when the rules are parsed for the new request. You can solve this by adding a RewriteCond to check if the path already is set to the expected value (i.e. only rewrite requests with the path set to /var/www/html, and skip any other rewrite – as it has already been rewritten).

    I’m going to suggest that it might be cleaner to do something like this through mod_vhost_alias, depending on your use case.

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

Sidebar

Related Questions

I have an web address: http://www.example.com/org/companyA I want to be able to pass CompanyA
I have something like: MEDIA_ROOT = '/home/httpd/foo/media/' MEDIA_URL = 'http://www.example.org/media/' (...) file = models.FileField(upload_to='test')
Say I have the website http://www.example.org and the corresponding Facebook page at http://www.facebook.com/example .
This code example is from the APE official website: http://www.ape-project.org/ var client = new
I have several sites in different domains: example.com , example.org , mail.example.com and passport.example.org
Anyone have an example snippet showing how to scale a Font using AffineTransform? Thanks.
I have an example in C# code, but it is using streamWriter . It
I have numerous index.php scripts using SEO-friendly arg format like example.com/path/to/index.php/opt/arg and would like
I have an InputStream that is returning, for example: <?xml version='1.0' ?><env:Envelope xmlns:env=http://schemas.xmlsoap.org/soap/envelope/><bbs:rule xmlns:bbs=http://com.foo/bbs>
I have tried reading: http://www.boost.org/doc/libs/1_41_0/boost/variant.hpp http://www.codeproject.com/KB/cpp/TTLTyplist.aspx and chapter 3 of Modern C++ Design but

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.