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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:02:37+00:00 2026-05-28T01:02:37+00:00

i have two websites, both websites contains few pages, and wordpress blog, please following

  • 0

i have two websites,

both websites contains few pages, and wordpress blog, please following structure

www.firstwebsite.com
-Root
  -index.html
  -about.html
  -Blog
    -blog page1
    -blog page2

www.secondwebsite.com
-Root
  -index.html
  -about.html
  -Blog
    -blog page1
    -blog page2

now, I want to redirect all the blog pages (i.e. pages under blog folder) of http://www.firstwebsite.com to the http://www.secondwebsite.com/blog, using htaccess 301 redirect.

I know i can redirect like

Redirect 301 /a.html www.secondwebsite.com/blog
Redirect 302 /b.html www.secondwebsite.com/blog

but if there any simple way, so i can redirect all pages by writing just line in .htaccess file, as destination for all the pages is same

  • 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-28T01:02:38+00:00Added an answer on May 28, 2026 at 1:02 am

    Use a RewriteRule for this

    RewriteEngine On
    # If the hostname for this request matches www.firstwebsite.com...
    RewriteCond %{HTTP_HOST} ^www\.firstwebsite\.com$ [NC]
    # Redirect all requests in Blog/ to the equivalent on www.secondwebsite.com
    RewriteRule Blog/(.*) http://www.secondwebsite.com/Blog/$1 [L,R=301,QSA]
    

    RewriteCond is a conditional match on the request’s hostname. So above, we’re only applying the rewrite to requests matching www.firstwebsite.com. The [NC] on the end makes it a case-insensitive match.

    The RewriteRule uses the expression Blog/(.*) to match all requests to the Blog directory, capturing everything after / in a match group. The request is then rewritten into www.secondwebsite.com/Blog using the match from the request (.*) as $1, so the whole request comes out identically in www.secondwebsite.com.

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

Sidebar

Related Questions

I have two websites https://www.foo.com and https://www.bar.com . bar.com is the actual application, but
I have two websites, domain1.com and domain2.com. The admin section of both website is
I have two websites A.com and B.com. I have to embedd B.com in an
I have two websites: http://example.com http://example.com/sub I have a page, let's say: http://example.com/sub/page1 Is
I have two websites on two different servers. When I print the following on
My scenario is this - I have two ASP.net websites. Both sites run on
I have two websites, A and B , very similar in configuration and both
I have two websites and i am using the same session object for both
I have built two websites, both of them use a custom membership provider I
I have two websites that are both running in shared mode in Windows Azure.

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.