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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:03:54+00:00 2026-06-12T01:03:54+00:00

We are trying to redirect everything from one domain to another with the following

  • 0

We are trying to redirect everything from one domain to another with the following

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule .? http://www.example2.com%{REQUEST_URI} [R=301,L]

When we visit http://www.example.com/v2sc

We are being redirected to http://www.example2.comv2sc

We would like to be redirected to http://www.example2.com/v2sc considering http://www.example2.comv2sc is not a valid hostname

Any ideas on how we can accomplish this?

Thank you!

  • 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-12T01:03:55+00:00Added an answer on June 12, 2026 at 1:03 am

    It seems like you’re using a .htaccess file for this. In that context the leading slash is not present in %{REQUEST_URI} so it’s up to you to put it back in.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !=www.example.com
    RewriteRule ^ http://www.example2.com/%{REQUEST_URI} [R=301]
    

    Please also note that solutions like this should be used only if you cannot edit the main server configuration file. Doing so would allow you to use a cleaner combination of vhosts and Redirect directives that would run much more quickly.

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

Sidebar

Related Questions

I've been trying everything to manage a redirect from www.domain.com to domain.com, but nothing
We've been trying to redirect from one action to another, hoping that data would
I am trying to redirect everything to a single page from my /website/folder/ directory.
I am trying to do a 301 redirect of everything from an old subdomain
im trying to redirect a subdirectory and everything beneath it to another url. for
So I have moved a website and am trying to 301 redirect everything, which
I'm trying to redirect a few pages to a new domain and I have
I am trying to redirect ALL requests for mydomain.com whether they are something like:
On Linux, I'm trying to redirect stdout from a console application to a file
I'm trying to create a Redirect timer plugin from all JS (JQuery) but for

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.