A
A
alexguardia12020-03-03 16:56:09
Apache HTTP Server
alexguardia1, 2020-03-03 16:56:09

How to close direct access to the site?

Hello, how can I close the direct entrance to the site? So that when you go directly to the site, it gives an error (skrn1), And when you go through the search engine, everything works and is displayed.5e5e61ec06d94553560220.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-03-03
@NeiroNx

Create .htaccess file containing:

RewriteEngine On

# block if request header X-SomeHeader doesn't exist
RewriteCond %{HTTP:X-SomeHeader} ^$
RewriteRule ^ - [F]

where X-SomeHeader is the header that appears when you go from search engines, which I xs - I tried to google, I was given a ton of shit about SEO.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question