![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 104 Pomógł: 3 Dołączył: 13.10.2004 Ostrzeżenie: (0%) ![]() ![]() |
Czy ktos wie, czemu po zastosowaniu takiej reguly w mod-rewrite
Kod RewriteCond %{HTTPS} ^on$ RewriteRule ^([a-z]+)$ http://%{HTTP_HOST}/$1.php [R] i wpisaniu w przegladarce np : https://domena/index przekierowuje mnie na http://domena/index.php zamiast http://domena/index Dla mnie jest to co najmniej dziwne |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Przyjaciele php.pl Postów: 5 724 Pomógł: 259 Dołączył: 13.04.2004 Skąd: N/A Ostrzeżenie: (0%) ![]() ![]() |
Eh?
1. Podajesz jedna z wielu regulek i tylko na jej podstawie mamy wiedziec co zle zrobiles? 2. Nadal nei rozumiem co chcesz osiagnac 3. Z tego co widze Kod RewriteCond %{HTTPS} ^on$ RewriteRule ^([a-z]+)$ http://%{HTTP_HOST}/$1.php [R] robisz redirecta z httpS do samego http. 4. RTFM Cytat 'redirect|R [=code]' (force redirect) Prefix Substitution with http://thishost[:thisport]/ (which makes the new URL a URI) to force a external redirection. If no code is given, a HTTP response of 302 (MOVED TEMPORARILY) will be returned. If you want to use other response codes, simply specify the appropriate number or use one of the following symbolic names: temp (default), permanent, seeother. Use this for rules to canonicalize the URL and return it to the client - to translate ``/~'' into ``/u/'', or to always append a slash to /u/user, etc. Note: When you use this flag, make sure that the substitution field is a valid URL! Otherwise, you will be redirecting to an invalid location. Remember that this flag on its own will only prepend http://thishost[:thisport]/ to the URL, and rewriting will continue. Usually, you will want to stop rewriting at this point, and redirect immediately. To stop rewriting, you should add the 'L' flag. While this is typically used for redirects, any valid status code can be given here. If the status code is outside the redirect range (300-399), then the Substitution string is dropped and rewriting is stopped as if the L flag was used. wykona ci: header( "Location: ....php" ) => czyli wykona kolejny request do web serwera => czyli zmieni URL w przegladarce a Kod RewriteRule ^([a-z]+)$ http://%{HTTP_HOST}/$1.php [R] oznacza przeciez: dopisz ".php" do request urla i przenies sie na http bez "S" |
|
|
![]() ![]() |
![]() |
Aktualny czas: 14.10.2025 - 12:16 |