I want example2.com to always appear in the address bar and show the content of my site example1.com.

I applied this solution, but if I enter example2.com, it redirects to example1.com but the address appears as example1.com.


In my .htacccess I have this code:

ReWriteEngine on

RewriteCond %{HTTP_HOST} ^example2.com
RewriteRule ^(.*) example1.com/$1 [P]

ReWriteRule ^sitemap/list_([0-9]+).xml$ user-uploads/sitemap/list_$1.xml [L]

ReWriteRule ^sitemap.xml$ user-uploads/sitemap.xml [L] 

What can I do? I need example2.com to appear in the address bar, and always show the content of example1.com.

  • 1
    Is that really what you want? Showing the same content for two different domains is bad for branding and horrible for SEO. Feb 22 at 11:25
  • 1
    Somebody voted to move this to Server Fault, however, they don't accept questions about managing domains and sites through virtualmin or cpanel. Questions there must be about managing servers (like having root access to the server.) It looks to me like this question is about websites, so it would be fine here. Feb 22 at 11:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.