Привет, я укрепляю сайт WordPress, который использует Apache в качестве веб-сервера. Я хочу заблокировать доступ с servername.admin.company.com. Я попытался отредактировать HTACCESS для другого ответа, который я видел здесь, но сайт начал 500 с https://domainname.com. Существует масса проблем с безопасностью, и мы решили, что лучший способ справиться с этим - просто полностью заблокировать доступ, поскольку никому действительно не нужно получать к нему доступ таким образом.
Вот мой файл vhosts:
' <Directory "/var/www/directory">
AllowOverride All
Options -Indexes +FollowSymLinks
Require all granted
Require not host servername.admin.company.com
</Directory>
DirectoryIndex index.php index.html
<VirtualHost *:80>
ServerName site.com
ServerAlias www.site.com
DocumentRoot "/var/www/directory"
# Enable HSTS (tell browsers to use only HTTP)
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload;"
<Directory "/var/www/html">
AllowOverride All
Options -Indexes +FollowSymLinks
Require all granted
</Directory>
RewriteEngine on
RewriteRule "^(.*/)?\.git/" - [F,L]
RedirectMatch 404 /\.git
</VirtualHost>
<VirtualHost *:80>
ServerName business.site.com
ServerAlias subdomain.site.com
ServerAlias www.business.site.com
DocumentRoot "/var/www/directory"
# Enable HSTS (tell browsers to use only HTTP)
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload;"
<Directory "/var/www/site">
AllowOverride All
Options -Indexes +FollowSymLinks
Require all granted
</Directory>
RewriteEngine on
RewriteRule "^(.*/)?\.git/" - [F,L]
RedirectMatch 404 /\.git
CustomLog /var/log/httpd/site-requests.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName business.site.com
ServerAlias directory.site.com
ServerAlias www.subfolder.site.com
DocumentRoot "/var/www/sitefolder"
# Enable HSTS (tell browsers to use only HTTP)
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload;"
<Directory "/var/www/sitefolder">
AllowOverride All
Options -Indexes +FollowSymLinks
Require all granted
</Directory>
RewriteEngine on
RewriteRule "^(.*/)?\.git/" - [F,L]
RedirectMatch 404 /\.git
CustomLog /var/log/httpd/sitefolder-requests.log combined
ErrorLog /var/log/httpd/sitefolder-error.log
</VirtualHost>
'