Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Blokowanie domeny PHP ?
Forum PHP.pl > Forum > Przedszkole
BloodyWampire
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.
Pyton_000
Nie za bardzo rozumiem o co Ci chodzi.
tenloginjestzajety
blokujesz w htaccess ( deny / allow ) ip, kraj itd.
BloodyWampire
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.
StrefaPi
htaccess

  1. RewriteEngine On
  2. RewriteCond %{HTTP_HOST} ts3 [NC]
  3. RewriteRule ^(.*)$ http: //domena.pl/$1 [L,R=301]
emstawicki
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.
Johnas
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
BloodyWampire
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>

Pyton_000
Mam nadzieję że widzisz tu spację:
Kod
http: //pentakillteam
i poprawiłeś ją.
BloodyWampire
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.

To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.