Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [.htaccess] Inny katalog głowny dla IP==127.0.0.1 i innego
infoo1
post
Post #1





Grupa: Zarejestrowani
Postów: 117
Pomógł: 0
Dołączył: 12.11.2008

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


.htaccess:
Kod
RewriteEngine On
         RewriteBase /
        
         RewriteCond %{REMOTE_ADDR} !127.0.0.1
         RewriteRule ^$ public/ [L]
         RewriteRule (.*) public/$1 [L]
        
         RewriteCond %{REMOTE_ADDR} 127.0.0.1
         RewriteRule ^$ private/ [L]
         RewriteRule (.*) private/$1 [L]

Czyli chcę, aby:
- mi (IP==127.0.0.1) pokazywało pod / zawartość /private/
- komuś z zewnątrz (IP!==127.0.0.1) pod / pokazało zawartość /public/
Niestety jest error 500 (IMG:http://forum.php.pl/style_emoticons/default/sciana.gif) . Ostatnia wolna linia jest, obsługa mod_rewrite też. Co źle zrobiłem?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
infoo1
post
Post #2





Grupa: Zarejestrowani
Postów: 117
Pomógł: 0
Dołączył: 12.11.2008

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


Zmieniłem na takie coś:
Kod
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REMOTE_ADDR} !127.0.0.1
RewriteRule ^(.*)$ public/$1 [L]

RewriteCond %{REMOTE_ADDR} 127.0.0.1
RewriteRule ^(.*)$ private/$1 [L]
</IfModule>
Nadal jest error 500.
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 4.10.2025 - 11:49