• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Pomóżcie z htaccess

Status
Not open for further replies.
A jak zrobić w html przekierowanie na ovned albo na index.php?
 
Stwórz plik index.php

Code:
<head>
<meta http-equiv="refresh" content="0; url=http://ip">
</head>
 
Czemu, skoro gosc juz jest na innej stronie?

Nie jest. To jest tylko nagłówek przygotowany do przesłania.

string

The header string.

There are two special-case header calls. The first is a header that starts with the string "HTTP/" (case is not significant), which will be used to figure out the HTTP status code to send. For example, if you have configured Apache to use a PHP script to handle requests for missing files (using the ErrorDocument directive), you may want to make sure that your script generates the proper status code.

<?php
header("HTTP/1.0 404 Not Found");
?>

The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless the 201 or a 3xx status code has already been set.

<?php
header("Location: http://www.example.com/"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>
 
<?php
header("Location: http://www.example.com/"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

A masz jakis kod "ponizej"?
 
Nie zaszkodzi wstawić exit, lepiej sie przyzwyczajac i potem nie robić takich głupich błędów, niż potem mieć pretensje, że "mi otsa shakowali : (" . . .
 
A co ma te "Tobie otsa shakowali" do tego redirecta?
 
Japierdole :/
Wystarczy w konfiguracji apache ustawić -Indexes i albo wylaczyć mod_autoindex ... Temat przerabiany 10000000 razy
 
po co exit?

Jak wspomniał masteusz, rzekomy redirect to tylko wpis w nagłówek, który jest wysyłany razem z resztą do przeglądarki i to ona decyduje co dalej. 'exit' przyśpiesza parsing time, ponieważ php nie doszukuje się więcej pod zakończeniem znacznika ("?>", gdzie zazwyczaj może być jeszcze HTML), tylko wysyła do apache to, co skompletował przed exit. Są to milisekundy, ale jednak masteusz ma rację.

a2dismod mod_autoindex i po kłopocie, jak napisał Zuoo.
 
Status
Not open for further replies.
Back
Top