Redirection confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: users@xxxxxxxxxxxxxxxx
- Subject: Redirection confusion
- From: Mike Dewhirst <miked@xxxxxxxxxxxxxxx>
- Date: Sat, 8 Feb 2025 21:31:44 +1100
- Reply-to: users@xxxxxxxxxxxxxxxx
- User-agent: Mozilla Thunderbird
I have a number of domain names which I want to redirect in order to
have a single search engine site.
mysite.com
mysite.com.au
mysite.au
www.mysite.com
www.mysite.com.au
www.mysite.au
I want mysite.com to be the single site for seo purposes. I want any
of the above to force redirection to mysite.com and not display the
user-entered domain.
Not only have I researched this via the docs I have asked three
different AIs and none of their solutions work as desired despite
seemingly complying with the docs. I have to accept the blame for
the prompts.
Here is my best guess at a proper redirection for all domain names
...
files: mysite.com.conf, www.mysite.com.conf, mysite.com.au.conf,
www.mysite.com.au.conf, mysite.au.conf, www.mysite.au.conf
<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.mysite.com mysite.com.au www.mysite.com.au
mysite.au www.mysite.au
RewriteEngine On
RewriteRule ^(.*)$ https://mysite.com/$1 [R=301,L]
Redirect permanent / https://mysite.com/
</VirtualHost>
end file mysite.com.au
All have been enabled (a2ensite ...) on Ubuntu 2024.04 LTS server
The main conf file for mysite.com is mysite.com-le-ssl.conf and it
has the *:443 configuration.
Many thanks for any education/clarification in layman terms.
Cheers
Mike
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature
[Index of Archives]
[Open SSH Users]
[Linux ACPI]
[Linux Kernel]
[Linux Laptop]
[Kernel Newbies]
[Security]
[Netfilter]
[Bugtraq]
[Squid]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Samba]
[Video 4 Linux]
[Device Mapper]