ðòïåëôù 


  áòèé÷ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  óôáôøé 


  ðåòóïîáìøîïå 


  ðòïçòáííù 



ðéûéôå
ðéóøíá












     áòèé÷ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rewrites ÄÌÑ SocialEngine


  • To: nginx-ru@xxxxxxxxx
  • Subject: Rewrites ÄÌÑ SocialEngine
  • From: Anton Koldaev <koldaevav@xxxxxxxxx>
  • Date: Fri, 14 Jan 2011 16:26:52 +0300
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=lzmCkLYFxsxLcKAQq5yd3SdDWWqC+nCdCK+1xaDPhA0=; b=b8zRCrGXwgWnFxS4kyV8K/mqKyFtD7mr7pfNneuNRn0lAJd5D7j1pgBR+SIKGCiQif paE4FSVITb8eEJbP+LKq8xhpPD277WKgHKOvIoCpILctCD06fHcRPk8v+XU+xhdf235r kWeL6otsDXA9eLBdAPz84E5dP5P4iXty0pcnY=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=OaiW1wB+TPFq1IS4hmDD5DLmwuDure3twayefTfVgEQ3VImtNG41qOOi0nCfQ1zK5J zxDPVAu5gxRKxL8ZQRv9UUGBBHil79LijBUpiC6F8f+T9VqAiBnC16TVD8rDfHcj01bb 27hqdgEjjeVb/Kc+BgcKimxgbvg8PtZl1L0jg=

ðÒÉ×ÅÔ
ðÒÏÛÕ ÐÏÍÏÝÉ × ÎÁÐÉÓÁÎÉÉ ÒÅ×ÒÁÊÔÏ× ÄÌÑ SocialEngine Ó Apache2+mod_rewrite ÎÁ nginx_0.7.67+php-fpm
ä×Á .htacess.
ðÅÒ×ÙÊ ËÏÒÎÅ×ÏÊ $DOCROOT/.htaccess:
šš# Get rid of index.php
ššRewriteCond %{REQUEST_URI} /index\.php
ššRewriteRule (.*) index.php?rewrite=2 [L,QSA]
šš# Rewrite all directory-looking urls
ššRewriteCond %{REQUEST_URI} /$
ššRewriteRule (.*) index.php?rewrite=1 [L,QSA]
šš# Try to route missing files
ššRewriteCond %{REQUEST_FILENAME} !-f
ššRewriteCond %{REQUEST_FILENAME} public\/ [OR]
ššRewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|ico|flv|htm|html|php|css|js)$
ššRewriteRule . - [L]
šš# If the file doesn't exist, rewrite to index
ššRewriteCond %{REQUEST_FILENAME} !-f
ššRewriteCond %{REQUEST_FILENAME} !-d
ššRewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA]
÷ÔÏÒÏÊ $DOCROOT/install/.htaccess:
šš# Get rid of index.php
ššRewriteCond %{REQUEST_URI} /index\.php
ššRewriteRule (.*) index.php?rewrite=2 [L,QSA]
šš# Rewrite all directory-looking urls
ššRewriteCond %{REQUEST_URI} /$
ššRewriteRule (.*) index.php?rewrite=1 [L,QSA]
šš# Special cases
ššRewriteCond %{REQUEST_URI} static
šš# RewriteRule (.*) Boostrap.php [L,QSA]
ššRewriteRule (.*) index.php?rewrite=1 [L,QSA]
šš# Try to route missing files
ššRewriteCond %{REQUEST_FILENAME} !-f
ššRewriteCond %{REQUEST_FILENAME} public\/ [OR]
ššRewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|ico|flv|htm|html|php|css|js)$
ššRewriteRule . - [L]
šš# If the file doesn't exist, rewrite to index
ššRewriteCond %{REQUEST_FILENAME} !-f
ššRewriteCond %{REQUEST_FILENAME} !-d
ššRewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA]
þÔÏ Õ ÍÅÎÑ ÐÏÌÕÞÁÅÔÓÑ:
# Get rid of index.php
ššlocation /index.php {
šš šrewrite ^/(.*)$ /index.php?rewrite=2 last;
šš}

šš# Rewrite all directory-looking urls
ššlocation ~ /$ {
šš šrewrite ^/(.*)$ /index.php?rewrite=1 last;
šš}

šš# Try to route missing files
îÅ ÚÎÁÀ, ËÁË ÐÅÒÅÐÉÓÁÔØ

šš# If the file doesn't exist, rewrite to index
šštry_files $uri $uri/ @exist;
ššlocation @exist {
šš šrewrite ^(.*)$ /index.php?rewrite=1 last;
šš}

ðÏÌÕÞÁÀ ÌÉÂÏ redirect loop ÌÉÂÏ 500. òÁÚÇÒÅÂÁÔØ rewrite-log nginx ÓÏ×ÍÅÓÔÎÏ Ó ÌÏÇÉËÏÊ SocialEngine ÄÏ×ÏÌØÎÏ ÓÌÏÖÎÏ. ðÒÏÛÕ ÐÏÍÏÞØ ÄÌÑ ÎÁÞÁÌÁ ÐÅÒÅÐÉÓÁÔØ ÄÏ ËÏÎÃÁ ÓÁÍÉ ÐÒÁ×ÉÌÁ, ×ÏÚÍÏÖÎÏ ×ÎÅÓÔÉ ËÏÒÒÅËÔÉÒÏ×ËÉ × ÍÎÏÊ ÎÁÐÉÓÁÎÎÙÅ.

--
Best regards,
Koldaev Anton
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.