Redirect Domain To a Different Domain's Particular Wordpress Page

SYSTEM INFORMATION
OS type and version Debian Linux 11
Virtualmin version 7.7

Hello,

I’ve seen similar posts on what may be the same issue and I am not sure if this is really something I can resolve with Virtualmin, or htaccess. I’ve tried both without success.

I need to forward a domain to a particular page on a different domains Wordpress page.

Here is the situation:

Domain-1 = Main domain
Domain-2 = Aliased domain via Virtualmin

Current behavior:
Entering domain-2 into the browser redirects to the root (Wordpress homepage) of domain-1.

Desired behavior:
Entering domain-2 into the browser redirects to a particular (Wordpress) page of domain-1. Example: https://domain-1.com/some-particular-wordpress-page

Is there a way to do this in Virtualmin?

I have tried to do this with htaccess without success. Examples:

RewriteCond %{HTTP_HOST} ^(www\.)?domain2.com$ [NC]
RewriteRule ^(.*) http://domain1.com/path/to/article/$1 [L,R]

Thanks

have you tried

vmin->server configuration->website redirects

this may be what you are looking for

@jimr1 - Thank you for your reply. However “Alias’” do not have the website redirects option in the menu. See attachments.

You should be looking in Services sorry a typo

@jimr1 - You were right the first time. There is a website redirects under the Server Configuration | Website Redirects but only for sub-domains. Website Redirects does not exist in the menu for Alias virtual servers.
It also in not under Services menu for Alias virtual server domains:

Any other suggestions on what I can do?

If anyone has a suggestion I’m still looking for a solution.

You could just put this code in a index.php file:

<?php header("Location: https://domain-1.com/some-particular-wordpress-page"); ?>

give up on Aliased Domain and instead create a brand new separate independent Virtualmin domain on the same server in the name of domain-2. Naturally you first need to delete the Aliased Domain before the system will allow you to create the second Virtualmin (virtual) server/domain on your Debian server.

then in the domain-2 environment, create a redirect to your desired target page in domain-1.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.