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

    • views 1298

    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 Where example.com is your domain, 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
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 receive some monetary compensation from hosting companies, however, this does not influence their positions in our ratings, test results, the direction or conclusions of our reviews in any way. We use this amount to provide better services, improve our website, to cover hosting testing account fees and team salaries. Ok

  • easy


    We ban anonymous users since 2016


    We do not delete reviews for money
    We do not sell rating positions
    We make cheating attempts almost impossible


    We test the hosting thoroughly and publish professional overviews
  • Rewards for reviews