Redirect from one domain to another, but continue to request a page

I want to create a redirect for one of my domains to another. I followed what was reported in this question and it works fine.

The problem I'm currently facing is that I want to redirect www.example.com/some-page www.new-example.com/some-page.

Right now, www.example.com/some-page is simply redirecting to www.new-example.com, which may confuse bookmarking users in some parts of the website.

Both URLs refer to the same web hosting, and I start the Litespeed server.

+3
source share
1 answer

Add the following to your .htaccess file:

RewriteCond %{HTTP_HOST} !^yourdomain.com [NC]
RewriteRule ^ http://yourdomain.com%{REQUEST_URI} [L,R=301]

: yourdomain.com , .

+3

All Articles