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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:50:14+00:00 2026-06-04T04:50:14+00:00

I have a VServer where i have some admin-apps in /var/www/, an other common

  • 0

I have a VServer where i have some admin-apps in /var/www/,
an other common stuff in /var/customers/webs/web001/.

I want to make a redirection for all not existing files and directories

            /var/www/ -> /var/customers/webs/web001/

So that i can use the domain-name for root and for web001 customer.

I am not sure what is the best way to achieve this.
I tried with mod_rewrite, but there are internal redirections that reach the Limit of Recursion.

What i am doing wrong?

.htaccess

            # allow psydo-location (not existing folder)
            Options +FollowSymLinks

            # Turn on URL rewriting engine
            RewriteEngine On

            # Folder of this htaccess-file in not root-folder
            RewriteBase /var/www/

            # Disable rewriting for existing files or directories
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_FILENAME} !^/var/customers/webs/web001/

            # redirect all other requests to index.php
            rewriteRule ^.*$ /var/customers/webs/web001/index.php [DPI,L]

apache2/error.log

            Request exceeded the limit of 10 internal redirects 
            due to probable configuration error. 
            Use 'LimitInternalRecursion' to increase the limit if necessary. 
            Use 'LogLevel debug' to get a backtrace.
            redirected from r->uri = /var/customers/webs/web001/index.php
            redirected from r->uri = /var/customers/webs/web001/index.php
            redirected from r->uri = /var/customers/webs/web001/index.php
            redirected from r->uri = /var/customers/webs/web001/index.php
            redirected from r->uri = /var/customers/webs/web001/index.php
            redirected from r->uri = /var/customers/webs/web001/index.php
            redirected from r->uri = /var/customers/webs/web001/index.php
            redirected from r->uri = /var/customers/webs/web001/index.php
            redirected from r->uri = /var/customers/webs/web001/index.php
            redirected from r->uri = /index.php

rewrite.log

            (3) [perdir /var/www/] strip per-dir prefix: /var/www/index.php -> index.php
            (3) [perdir /var/www/] applying pattern '^.*$' to uri 'index.php'
            (4) [perdir /var/www/] RewriteCond: input='/var/www/index.php' pattern='!-f' => matched
            (4) [perdir /var/www/] RewriteCond: input='/var/www/index.php' pattern='!-d' => matched
            (4) [perdir /var/www/] RewriteCond: input='/var/www/index.php' pattern='!^/var/customers/webs/web001/' => matched
            (2) [perdir /var/www/] rewrite 'index.php' -> '/var/customers/webs/web001/index.php'
            (2) [perdir /var/www/] trying to replace prefix /var/www/ with /var/www/
            (1) [perdir /var/www/] internal redirect with /var/customers/webs/web001/index.php [INTERNAL REDIRECT]
            (3) [perdir /var/www/] add path info postfix: /var/www/var -> /var/www/var/customers/webs/web001/index.php
  • 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-06-04T04:50:16+00:00Added an answer on June 4, 2026 at 4:50 am

    Ok. I found a Solution.
    It is not in the .htaccess, but in the httpd.conf.
    With appropriate settings for DocumentRoot almost all request will be delivered form /var/customers/webs/web001/,
    except of these who will be excluded with Alias-Directives.

    The /etc/apache2/httpd.conf look something like that:

                #NameVirtualHost SERVER_IP:PORT
                <VirtualHost SERVER_IP:PORT>
                    ServerName SERVER_IP
                    ServerAlias DOMAIN.TLD
    
                    # instead of DocumentRoot "/var/www/"
                    DocumentRoot "/var/customers/webs/web001/"
    
                    # add Aliases for each Application in the /var/www
                    Alias /URL_SUB_PATH_APP_1 "/var/www/URL_SUB_PATH_APP_1"
                    Alias /URL_SUB_PATH_APP_2 "/var/www/URL_SUB_PATH_APP_2"
                </VirtualHost>
    
                Include /etc/apache2/vhosts.conf
    

    Like Gerben said, the .htaccess-file is for this purpose not helpful.

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

Sidebar

Related Questions

Have some code: using (var ctx = new testDataContext()) { var options = new
Have two UIBarButtonItems want to make it as one UIBarButtonItem and toggle between them
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:
Have a look at this url: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jquery_ui_methods#column_chooser I have got the Column Chooser dialog
Have finally got a responsive site working (of a fashion). What I want to
have been trying couple of hours now to make my iphone app universal. The
Have some dates in my local Oracle 11g database that are in this format:
Have you seen library for flexible working with terminal(Unix like)? I want to implement
I have a vserver (Debian Squeeze, 32Bit) with Apache preinstalled. I installed Letty and
I have a server with debian. Server host X vservers (for example 1vserver to

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.