D
D
DiPokemon2020-11-20 13:00:11
Domain Name System
DiPokemon, 2020-11-20 13:00:11

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

The task was to create several regional subdomains for the site, while all of them use the files of the main domain and dynamically change the title, description and other things. All this was done and even worked, but the next day it didn’t work anymore.
The DNS records are correct, at least the hosting TP said so. I think the problem is in htaccess, but its configuration is a complete layman.
I am attaching the .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>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question