将域重写到另一个域的子文件夹

I currently have this page --

www.example.com/landing-page

But I would like to use a different domain for it, i.e. www.example2.com

I'm using cPanel on a Linux machine (LAMP), could this be done via .htaccess?

Any help would be much appreciated - thanks!

You can do this via apache's VirtualHosts, open your apache/conf/extra/httpd-vhosts.conf file and apply something like this inside it:

VirtualHostName example2.com:80
<VirtualHost example2.com:80>
    DocumentRoot "/var/www/htdocs/landing-page"
    ServerName example2.com
</VirtualHost>

JAVASCRIPT REDIRECT:

Paste this at the top of your page on the old site just after the tag.

<script type="text/javascript">
window.location = "http://www.newsite.com/"
</script>

Naturally, you'd replace "http://www.newsite.com/" with wherever you wanted the page to redirect to.

It should redirect you instantly. So anyone visiting the old site page will instantly redirect to newsite.com

PHP REDIRECT (301, permanently moved):

<?
Header( "HTTP/1.1 301 Moved Permanently" ); 
Header( "Location: http://www.newsite.com/" ); 
?>

Place that at the top of your page. It isn't as nice as the javascript one, but it is SEO FRIENDLY, which I think you're looking for.