Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Nginx + rewrite
zomo
post 8.02.2011, 12:20:39
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 30.04.2005

Ostrzeżenie: (30%)
XX---


Witam,
Mógłby mi powiedzieć ktoś jak bedzię wygladała regułka rewrite dla nginx?
Z góry dzięki za pomoc

Plik .htaccess

  1. Options FollowSymLinks
  2. RewriteEngine On
  3. RewriteBase /p/
  4.  
  5.  
  6. RewriteCond %{HTTP_HOST} !^www. [NC]
  7.  
  8. RewriteCond %{HTTP_HOST} ![0-9]$ [NC]
  9. RewriteRule ^(.*)$ [url="http://www.%{HTTP_HOST}/$1"]http://www.%{HTTP_HOST}/$1[/url] [R=301]
  10.  
  11.  
  12. RewriteCond %{REQUEST_URI} ^\/$
  13. RewriteCond %{QUERY_STRING} ^$
  14. RewriteRule ^(.*)$ pl/ [L]
  15.  
  16.  
  17. RewriteRule ^(index.php)$ pl/$1 [L]
  18.  
  19.  
  20. RewriteCond %{REQUEST_URI} ^/images.+$
  21. RewriteRule ^.+(images/.+)$ pl/$1 [L]
  22.  
  23.  
  24. RewriteRule ^(pl\/)([a-zA-Z0-9_-]+),{1}([0-9]+),{1}([0-9]+)$ $2,$3,$4 [R=301]
  25. RewriteRule ^(pl\/)([a-zA-Z0-9_-]+),{1}([0-9]+)$ $2,$3 [R=301]
  26.  
  27.  
  28. RewriteCond %{REQUEST_FILENAME} !-f
  29. RewriteCond %{REQUEST_FILENAME} !-d
  30. RewriteRule ^(.+)([a-zA-Z0-9_-]+),{1}([0-9]+),{1}([0-9]+)$ pl/index.php?id=$3&idd=$4 [L]
  31. RewriteCond %{REQUEST_FILENAME} !-f
  32. RewriteCond %{REQUEST_FILENAME} !-d
  33. RewriteRule ^(.+)([a-zA-Z0-9_-]+),{1}([0-9]+)$ pl/index.php?id=$3 [L]


Ten post edytował zomo 8.02.2011, 12:27:43
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
webdice
post 8.02.2011, 12:23:49
Post #2


Developer


Grupa: Moderatorzy
Postów: 3 045
Pomógł: 290
Dołączył: 20.01.2007




Proszę dodać bbcode.
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 25.07.2025 - 09:50