Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> problem z mod_rewrite
Ozzy
post
Post #1





Grupa: Zarejestrowani
Postów: 204
Pomógł: 0
Dołączył: 26.12.2003
Skąd: Rzeszów

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


Zastosowałem się do instrukcji na http://php.faq.pl/docs/rewrite.php , jednak kod, który jest tam napisany nie działa tak jak powinien (Windows).

Kod
RewriteRule ^/(files|images)/(.*)$ /monstrum/php/$1/$2 [l]

RewriteRule !^/(files|images)/.*$ /monstrum/php/index.php [l]


powoduje Internal Server Error

gdy zmienię na:

Kod
RewriteBase /monstrum/php/

RewriteRule ^(files|images)/(.*)$ $1/$2 [l]

RewriteRule !^(files|images)/.*$ index.php [l]


wydaje się działać, jednak tylko dla adresów takich jak: /monstrum/php/test i monstrum/php/test_123.
Nie działa natomiast w przypadku gdy dodam jeszcze jeden znak /, czyli: /monstrum/php/test/ lub /monstrum/php/test/123

strona otwiera się, jednak bez plików z folderów files i images

Pomocy:)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Ozzy
post
Post #2





Grupa: Zarejestrowani
Postów: 204
Pomógł: 0
Dołączył: 26.12.2003
Skąd: Rzeszów

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


Kod
RewriteRule ^/(files|images)/(.*)$ /monstrum/php/$1/$2 [L]

RewriteRule .* /monstrum/php/index.php [L]


powoduje:
Kod
Internal Server Error

Mon Mar 22 14:44:42 2004] [error] [client 127.0.0.1] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.


Cytat
Moze to Ci pomoze


działa coś takiego:
Kod
RewriteEngine on

RewriteRule        (^|/)images/(.*)$          images/$2             [L]

RewriteRule        (^|/)files/(.*).css$        files/$2.css            [L]

RewriteRule        .* index.php                                              [L]


Przynajmniej taki mi się narazie wydaje;))
Jedyna wada, to to, że wyraźnie wolniej się ładuje.

Update: Już chyba dobrze chodzi, może mi się tylko wydawało.

Ostatecznie zostało na:
Kod
RewriteEngine on

RewriteRule        (^|/)(images|files)/(.*)$        $2/$3  [L]

RewriteRule        .* index.php    [L]


Dzięki dooshek i wszystkim, którzy próbowali pomóc.
Nareszcie się wyśpie!

I jeszcze pytanie na koniec:
Mogę tego używać bez obaw, że zostanie wykorzystane do niecnych celów?(IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
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: 30.12.2025 - 19:46