I had a subdomain https://sub.rootdir.com/ which was migrated to the root domain and to a new host. I want to redirect this subdomain to the root folder. The host told me to re-create the subdomain and then create an '.htaccess' file in which you can set redirection rules such as: Redirect 301 / https://rootdir.com/
I have kind of no idea what to type in the htaccess file. Can I please get help from you?
Create a .htaccess file in your subdomain folder and enter this code in;
RewriteEngine On
RewriteCond %{HTTP_HOST} !^rootdir\.com
RewriteRule (.*) https://rootdir.com/$1 [R=301,L]