Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Blokowanie domeny PHP ?, Jak zablokować dostęp do strony www z danej domeny ?
BloodyWampire
post 26.11.2016, 18:06:32
Post #1





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 29.10.2014

Ostrzeżenie: (0%)
-----


Witam.
Chciałbym zablokować dostęp do mojej strony osobom które korzystają z adresu poddomena.domena.pl .
Poddomeny używam do serwera ts3. Próbowałem ustawić rekord SRV w dns ale nic to nie dało :/
Jeśli jest taka opcja to prosze o jakiś poradnik, etc.
Go to the top of the page
+Quote Post
Pyton_000
post 26.11.2016, 19:39:38
Post #2





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Nie za bardzo rozumiem o co Ci chodzi.
Go to the top of the page
+Quote Post
tenloginjestzaje...
post 26.11.2016, 20:07:48
Post #3





Grupa: Zarejestrowani
Postów: 358
Pomógł: 1
Dołączył: 20.07.2014

Ostrzeżenie: (0%)
-----


blokujesz w htaccess ( deny / allow ) ip, kraj itd.


--------------------
Nigdy nie zapominam kliknąć "pomógł". Zastosowanie na stronie [prosze nie spamuj]
Go to the top of the page
+Quote Post
BloodyWampire
post 27.11.2016, 17:48:45
Post #4





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 29.10.2014

Ostrzeżenie: (0%)
-----


Ale mi nie chodzi o zablokowanie konkretnej osoby.
Chodzi mi o to że mam domene (np domena.pl) i subdomene (np. ts3.domena.pl).
I chciałbym zablokować możliwość wejścia na strone przez subdomene.
Wiem że można to zrobić przez rekord SRV ale mi to nie działa.
Problem jest taki że serwer www i ts3 mam na jednym vps i gdy wpiszę w przeglądarce ts3.domena.pl
to wyświetla mi się strona www a chciałbym żeby z tego adresu można było połączyć się tylko
z serwerem ts3.
Go to the top of the page
+Quote Post
StrefaPi
post 27.11.2016, 19:57:55
Post #5





Grupa: Zarejestrowani
Postów: 232
Pomógł: 50
Dołączył: 2.03.2013

Ostrzeżenie: (0%)
-----


htaccess

  1. RewriteEngine On
  2. RewriteCond %{HTTP_HOST} ts3 [NC]
  3. RewriteRule ^(.*)$ http: //domena.pl/$1 [L,R=301]


Ten post edytował StrefaPi 27.11.2016, 19:58:49


--------------------
https://studiostawki.com - studio fotograficzne i filmowe - ul. Inflancka 11, Warszawa
Go to the top of the page
+Quote Post
emstawicki
post 28.11.2016, 08:32:15
Post #6





Grupa: Zarejestrowani
Postów: 207
Pomógł: 40
Dołączył: 2.06.2016
Skąd: Olsztyn

Ostrzeżenie: (0%)
-----


Dlaczego proponujecie sprzątać błędy htaccessem?
Pokaż jak wygląda konfiguracja DNS, bo w niej jest błąd i pewnie jeszcze serwer http nie rozróżnia nazwy domenowej tylko wyświetla zawsze to samo, obojętnie co nie skieruje na adres IP.


--------------------
Jak w Olsztynie, to tylko w Revolver Rock Cafe .
Sprawdź postęp propagacji DNS
Go to the top of the page
+Quote Post
Johnas
post 28.11.2016, 12:08:44
Post #7





Grupa: Zarejestrowani
Postów: 650
Pomógł: 16
Dołączył: 5.07.2010
Skąd: Ściśle Tajne

Ostrzeżenie: (0%)
-----


Cytat(emstawicki @ 28.11.2016, 08:32:15 ) *
Dlaczego proponujecie sprzątać błędy htaccessem?
Pokaż jak wygląda konfiguracja DNS, bo w niej jest błąd i pewnie jeszcze serwer http nie rozróżnia nazwy domenowej tylko wyświetla zawsze to samo, obojętnie co nie skieruje na adres IP.


Bo kolega noe chce aby ktoś wchodzil na jego stronę przez subdomene typu ts3.domena.pl więc zamiast blokować subdomene wyłączając ją , bardziej rozsądnym wyjściem jest utworzenie przekierowania w pliku .htaccess. Popraw mnie jeśli się myle


--------------------
Jak coś jest dobre, to nie znaczy że nie może być to lepsze - Ideały nie istnieją ;D
Strony internetowe Świnoujście
Go to the top of the page
+Quote Post
BloodyWampire
post 28.11.2016, 16:09:13
Post #8





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 29.10.2014

Ostrzeżenie: (0%)
-----


Cytat(StrefaPi @ 27.11.2016, 19:57:55 ) *
htaccess

  1. RewriteEngine On
  2. RewriteCond %{HTTP_HOST} ts3 [NC]
  3. RewriteRule ^(.*)$ http: //domena.pl/$1 [L,R=301]


Nie działa sad.gif

Mój plik .htaccess :

  1. AddDefaultCharset UTF-8
  2.  
  3. # DISABLE DIRECTORY LISTING
  4. Options -Indexes
  5.  
  6. SetEnv HTACCESS on
  7.  
  8. ErrorDocument 403 "<!DOCTYPE html><html lang=\"en\"><head> <meta charset=\"utf-8\"> <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"> <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"> <meta name=\"author\" content=\"Wruczek\"> <title>403 - Forbidden</title> <link rel=\"shortcut icon\" href=\"img/icon/icon-64.png\" style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;\"></head><body style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;margin: 0;font-family: &quot;Lato&quot;,&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;font-size: 15px;line-height: 1.42857143;color: #ebebeb;background-color: #2b3e50;\"> <div class=\"container\" style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;margin-right: auto;margin-left: auto;padding-left: 15px;padding-right: 15px;display: table;position: absolute;height: 100%;width: 100%;\"> <div class=\"text-center\" style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;text-align: center;display: table-cell;vertical-align: middle;\"> <h1 style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;font-size: 39px;margin: 0.67em 0;font-family: inherit;font-weight: 400;line-height: 1.1;color: inherit;margin-top: 21px;margin-bottom: 10.5px;\">403 <span style=\"font-size: 32px;color: #9E9E9E;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;\">Forbidden</span></h1> <h3 style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;orphans: 3;widows: 3;page-break-after: avoid;font-family: inherit;font-weight: 400;line-height: 1.1;color: inherit;margin-top: 21px;margin-bottom: 10.5px;font-size: 26px;\">Access to this page is forbidden.</h3> <br style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;\"> <a href=\".\" class=\"btn btn-primary btn-lg\" style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;background-color: #df691a;color: #ffffff;text-decoration: none;display: inline-block;margin-bottom: 0;font-weight: normal;text-align: center;vertical-align: middle;-ms-touch-action: manipulation;touch-action: manipulation;cursor: pointer;background-image: none;border: 1px solid transparent;white-space: nowrap;padding: 12px 24px;font-size: 19px;line-height: 1.3333333;border-radius: 0;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;border-color: transparent;\">&larr;&nbsp;&nbsp;&nbsp;Go back</a> </div></div></body></html>"
  9.  
  10. ErrorDocument 404 "<!DOCTYPE html><html lang=\"en\"><head> <meta charset=\"utf-8\"> <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"> <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"> <meta name=\"author\" content=\"Wruczek\"> <title>404 - Not found</title> <link rel=\"shortcut icon\" href=\"img/icon/icon-64.png\"></head><body style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;margin: 0;font-family: &quot;Lato&quot;,&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;font-size: 15px;line-height: 1.42857143;color: #ebebeb;background-color: #2b3e50;\"> <div class=\"container\" style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;margin-right: auto;margin-left: auto;padding-left: 15px;padding-right: 15px;display: table;position: absolute;height: 100%;width: 100%;\"> <div class=\"text-center\" style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;text-align: center;display: table-cell;vertical-align: middle;\"> <h1 style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;font-size: 39px;margin: 0.67em 0;font-family: inherit;font-weight: 400;line-height: 1.1;color: inherit;margin-top: 21px;margin-bottom: 10.5px;\">404 <span style=\"font-size: 32px;color: #9E9E9E;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;\">page not found</span></h1> <h3 style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;orphans: 3;widows: 3;page-break-after: avoid;font-family: inherit;font-weight: 400;line-height: 1.1;color: inherit;margin-top: 21px;margin-bottom: 10.5px;font-size: 26px;\">We couldn't find what you were looking for.</h3> <br style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;\"> <a href=\".\" class=\"btn btn-primary btn-lg\" style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;background-color: #df691a;color: #ffffff;text-decoration: none;display: inline-block;margin-bottom: 0;font-weight: normal;text-align: center;vertical-align: middle;-ms-touch-action: manipulation;touch-action: manipulation;cursor: pointer;background-image: none;border: 1px solid transparent;white-space: nowrap;padding: 12px 24px;font-size: 19px;line-height: 1.3333333;border-radius: 0;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;border-color: transparent;\">&larr;&nbsp;&nbsp;&nbsp;Go back</a> </div></div></body></html>"
  11.  
  12. ErrorDocument 500 "<!DOCTYPE html><html lang=\"en\"><head> <meta charset=\"utf-8\"> <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"> <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"> <meta name=\"author\" content=\"Wruczek\"> <title>500 - server error</title> <link rel=\"shortcut icon\" href=\"img/icon/icon-64.png\"></head><body style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;margin: 0;font-family: &quot;Lato&quot;,&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;font-size: 15px;line-height: 1.42857143;color: #ebebeb;background-color: #2b3e50;\"> <div class=\"container\" style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;margin-right: auto;margin-left: auto;padding-left: 15px;padding-right: 15px;display: table;position: absolute;height: 100%;width: 100%;\"> <div class=\"text-center\" style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;text-align: center;display: table-cell;vertical-align: middle;\"> <h1 style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;font-size: 39px;margin: 0.67em 0;font-family: inherit;font-weight: 400;line-height: 1.1;color: inherit;margin-top: 21px;margin-bottom: 10.5px;\">500 <span style=\"font-size: 32px;color: #9E9E9E;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;\">server error</span></h1> <h3 style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;orphans: 3;widows: 3;page-break-after: avoid;font-family: inherit;font-weight: 400;line-height: 1.1;color: inherit;margin-top: 21px;margin-bottom: 10.5px;font-size: 26px;\">Something went wrong. Try again later.</h3> <br style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;\"> <a href=\".\" class=\"btn btn-primary btn-lg\" style=\"-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;background-color: #df691a;color: #ffffff;text-decoration: none;display: inline-block;margin-bottom: 0;font-weight: normal;text-align: center;vertical-align: middle;-ms-touch-action: manipulation;touch-action: manipulation;cursor: pointer;background-image: none;border: 1px solid transparent;white-space: nowrap;padding: 12px 24px;font-size: 19px;line-height: 1.3333333;border-radius: 0;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;border-color: transparent;\">&larr;&nbsp;&nbsp;&nbsp;Go back</a> </div></div></body></html>"
  13.  
  14.  
  15. <IfModule mod_rewrite.c>
  16.  
  17. RewriteEngine On
  18. RewriteCond %{HTTP_HOST} ts3 [NC]
  19. RewriteRule ^(.*)$ http: //pentakillteam.tk/$1 [L,R=301]
  20.  
  21. </IfModule>
  22.  
  23. # Enable GZIP
  24. <ifmodule mod_deflate.c>
  25. AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
  26. BrowserMatch ^Mozilla/4 gzip-only-text/html
  27. BrowserMatch ^Mozilla/4\.0[678] no-gzip
  28. BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  29. </ifmodule>

Go to the top of the page
+Quote Post
Pyton_000
post 28.11.2016, 20:27:58
Post #9





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Mam nadzieję że widzisz tu spację:
Kod
http: //pentakillteam
i poprawiłeś ją.
Go to the top of the page
+Quote Post
BloodyWampire
post 29.11.2016, 17:54:48
Post #10





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 29.10.2014

Ostrzeżenie: (0%)
-----


Cytat(Pyton_000 @ 28.11.2016, 20:27:58 ) *
Mam nadzieję że widzisz tu spację:
Kod
http: //pentakillteam
i poprawiłeś ją.


Tak. Nadal nie działa.

Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 25.05.2024 - 05:13