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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:13:36+00:00 2026-05-24T13:13:36+00:00

I have 2 domains .com and .net. I would like to redirect the .net

  • 0

I have 2 domains .com and .net.

I would like to redirect the .net to .com domain with the full URL, so just the domain changes. For examples:

If a user visits:

http://www.example.net/images/myImage.png  he gets redirected (using 301 redirect) to http://www.example.com/images/myImage.png.
http://www.example.net/images goes to http://www.example.com/images
http://www.example.net/index.php?att=1&att=2 goes to http://www.example.com/index.php?att=1&att=2

I tried this:

 RewriteEngine on
 RewriteCond %{HTTP_HOST} !.com$
 RewriteRule /(.*) http://www.example.com/%{REQUEST_URI}$1 [L,R=301] 

But if the query string (?att=1&att2=3…) isn’t set it goes directly to http://www.example.com

Is this even possible?

  • 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-24T13:13:36+00:00Added an answer on May 24, 2026 at 1:13 pm

    This always works for me:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !.com$
    RewriteRule .* http://www.example.com%{REQUEST_URI} [L,R=301]
    

    or, if you prefer:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !.com$
    RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
    

    If still nothing — try adding QSA flag (but it should work fine as is):

    RewriteRule ^(.*)$ http://www.example.com/$1 [QSA,L,R=301]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have domain.com using asp.net mvc2 technology and domain.com/blog would use
I'd like to do an Nginx rewrite where I have two domains: domain.com and
We're using URLRewriter (http://urlrewriter.net), and would like to rewrite queries like this: domain.com/find/red-boots to
I have two ASP.NET 4.0 sites on Win2008R2 IIS7, e.g. demo1.site.domain.com and demo2.site.domain.com, and
I have a website with three domains .com, .de and .it Each domain needs
I have 10 top-level domains e.g. example1.com, example2.com, example3.com, etc, and each domain has
I have the ajax query var url = http://ISAServer.domain.com/WebSite; $.ajax({ url: url, success: function
I have two domains - abc.com and xyz.com. I have a CNAME that points
I have a Magento install with multiple domains (domain1.com, domain2.com) sharing a single checkout
I have several sites in different domains: example.com , example.org , mail.example.com and passport.example.org

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.