Answer the question
In order to leave comments, you need to log in
How to block access to the site from other domains?
Hello! I'm actively developing the SquadyFinder project, which is located at: squadyfinder.com
The project is developed on Laravel, deployed on DigitalOcean (512 MB Memory / 20 GB Disk / FRA1 - Ubuntu 15.10 x32)
The domain was purchased from https://www.namecheap.com /
Thanks to Yandex.Metrica, I found out that my project is also available from other domains, for example:
rewoi989s.com
g0293.com
77kinglion.info
adstprem3983.com
I tried to configure Apache, but the site crashes both on my domain and on others. I suspected that on those domains the project was loaded in an iframe, since I tried to register there or subscribe to an email newsletter - everything goes into my database. And if I make any changes in the project, they also immediately change there.
Has anyone come across this problem and can suggest how to solve it? Maybe I configured something wrong? Thanks in advance.
.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
#Normal way (in case you need to deploy to NON-heroku)
RewriteCond %{HTTPS} !=on
</IfModule>
RewriteEngine On
RewriteCond %{http_host} !^squadyfinder.com [nc]
RewriteRule ^(.*)$ http://squadyfinder.com/$1 [r=404,nc]
Answer the question
In order to leave comments, you need to log in
Bury the corpse of an old Indian.
For nginx do this:
if ($host !~* ^(site.xxx)$ ) {
return 444;
}
Put in the page template, in the header section (and, of course, the web server config - must also be configured):
<script type="text/javascript" language="javascript">
if(self!=top) top.location=self.location;
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question