Hello guys. I have a question for which I can’t find the answer. Assuming it is a simple task and people actually don’t have that problem, but somehow I can’t resolve it.
I run 5 sites and email for each site on the same server. When I configure MX and A record for mail.mydomain.com everything is working fine. However, from an SEO point of view, it is not a good idea for mail.maydomain.com to be accessible for web traffic.
Is there any good solution to my problem? Any chance I can redirect mail.mydomain.com to open the Usermin login screen instead opening my sites with email subdomain ? Something like webmail.mydomain.com redirect work?
OK, this is the error message I get when make changes inside htaccess
Found
The document has moved here.
Additionally, a 302 Found error was encountered while trying to use an ErrorDocument to handle the request.
Also, I have made changes inside Virtualmin --> Services --> Configure Website --> Edit Directives without results. mail.mydomain.com opens homepage like there is no directive inside that file.
This is how my htaccess looks when I enter these directives
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTP_HOST} =mail.mydomain.com
RewriteRule ^(?!/.well-known)(.*) https://mydomain.com:20202/ [R]
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Sorry didn’t read. You use the htaccess. I use Webmin – Servers – Apache Webserver. I edit the Virtual Server for the domain and use Edit Directives. For both port 80 and 443.
First of all, I tried both ways (htaccess & Webmin-Servers-Apache Webserver). Didn’t work.
Now, what I didn’t know that there are two directives (port 80 & port 443), and you gave me that clue. Yesterday I made changes for port 80, which is the reason it didn’t work. I use SSL and for that reason I didn’t saw any redirect.