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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:21:55+00:00 2026-06-02T06:21:55+00:00

I have an Apache server with two domains (via VirtualHost) on it. The file

  • 0

I have an Apache server with two domains (via VirtualHost) on it.
The file setup is like this: /example1/example2/
example1 is the root for www.example1.com
example2 is the root for www.example2.com
I would like for www.example1.com/example2/<whatever else> to redirect to www.example2.com/<whatever else>
I have access to the main Apache configuration file. Any tips on how to do this? I’m not very familiar with configuring Apache, so any explanations would be very much appreciated.

The other questions related to this one lacked explanations, so I felt I had to post my own question.

  • 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-02T06:21:56+00:00Added an answer on June 2, 2026 at 6:21 am

    You can use an .htaccess file to do this pretty quickly. In www.example1.com/example2/, you would create this .htaccess file.

    <VirtualHost *:80>
        ...
        <Directory /path/to/vhost/>
          RewriteEngine on
          RewriteBase /example2/
          RewriteRule ^(.*)$ http://www.example2.com/$1 [R=301]
        </Directory>
    </VirtualHost>
    

    This does assume that you want the redirect to be a 301, and that the example2 folder has AllowOverride All set.

    This rule works using regex to capture the incoming URL, sans the example2 bit, then appending it to the rewritten URL. The R in the square brackets tells Apache to use a Location header to the rewritten URL. The =301 tells Apache to use a 301 Permanent Redirect header.

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

Sidebar

Related Questions

I have two servers: Fedora running Apache/2.2.14 (old server) CentOs running Apache/2.2.3 (new server)
I have this Perl script sitting in the cgi-bin folder of my Apache server:
I have setup svnserve server (1.6.5,plain, without apache) on Fedora. The users, who has
I have apache installed on one of my server on two different ports, all
all. I've got two domains set up under apache on a single server (Linux).
I have two PHP applications on the same Apache server. At some point, application
I would like to enable SOAP on my PHP5/Centos/Apache server. I have full access
We currently have two EC2 servers running apache servers with django wsgi on freebsd.
I have my Apache http server running on localhost:80 and restlet server on localhost:8182,
I have installed apache on my server however I can not browse my website

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.