• How to create a redirect from any subdomain to the main domain?

    • views 1084

    Good afternoon. I want to make a redirect from my now nonexistent subdomains (such as lalala.site.com or 1234.site.com) to the main domain site.com

    Solutions (1)
    1.Add an A record to the DNS records of the domain, for example * .example.com. A 10.0.0.1 Where example.com is your domain, 10.0.0.1 is the IP address to which your domain refers. If this option is not available in the hosting panel, contact your hosting tech support with the problem.  2. In the .htaccess file that should be in the site directory, register RewriteEngine On RewriteCond% {HTTP_HOST}!^Example\.com$ RewriteRule^(. *)$ Http://example.com/$1 Where example.com is your domain.
    Answers (1)
    The whole code will be displayed on one line, it will not be easy to read. In Apache, the .htaccess file: RewriteEngine On RewriteCond% {HTTP_HOST}^(. +)\.Site\.com$ RewriteRule ^ http://site.com/
We do our best for you!
Rate the article
or
Tell the world about it

Users (0) 0 of 5

  • In order to provide you with the best online experience this website uses personal data (cookies, IP, email, photo, name, website, etc). By using our website, you agree to our use of your personal data. More info we get commissions from the hostings, but our ratings are honest and the reviews are real.
  • Important

    We are in BETA. We need your help!

    Anonymous reviews are not allowed!

    Every month we add $50 to the account of a randomly selected user.*

    In addition, you will receive a free permanent link to your site after you leave an honest review!