Redirect from subdomain to domain with preserving URL. 500 Internal Server Error?

  • 0
    The task was to create several regional subdomains for the site, so that they all use the files of the main domain and dynamically change the title, description and other different things. All this was done and even worked, but the next day it doesn't work anymore.
    DNS records are correct, at least TP hosting said so. I think the problem is in htaccess, but its configuration is a complete ignoramus.
    I am attaching .htaccess code
    #Options +FollowSymLinks +ExecCGI
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^as-gard.ru
      RewriteRule (.*) http://www.as-gard.ru/$1 [R=301,L]
      # uncomment the following line, if you are having trouble
      # getting no_script_name to work
      #RewriteBase /
    
      # we skip all files with .something
      #RewriteCond %{REQUEST_URI} \..+$
      #RewriteCond %{REQUEST_URI} !\.html$
      #RewriteRule .* - [L]
    
      # we check if the .html version is here (caching)
      RewriteRule ^$ index.html [QSA]
      RewriteRule ^([^.]+)$ $1.html [QSA]
      RewriteCond %{REQUEST_FILENAME} !-f
    
      # no, so we redirect to our front web controller
      RewriteRule ^(.*)$ index.php [QSA,L]
    </IfModule>
    htaccess Anonymous, Mar 15, 2019

  • 0 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!