Welcome! Log In Create A New Profile

Advanced

Re: Помогите переписать .htaccess

August 31, 2010 06:23PM
Путем научного тыка обнаружил конфликт
[code]
location ^~ /lin/ {
rewrite ^/lin/line_(.*)_beg_(.*)_wmax_(.*)_wcur_(.*)_wmin(.*)\.jpg$ /lin/img.php?line=$1&beg=$2&wmax=$3&wcur=$4&wmin=$5 break;
}
[/code]

И вот этого.
[code]
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
[/code]

Сайт работает под управлением Drupal и второй кусок кода нужен для корректной работы чистых ссылок, однако, он не даёт выполняться 1й части кода.
Обе части нужны, но 1-я должна выполняться только в sitename/lin/ первой.
Посоветуйте как быть?

Полный конфиг:

[code]
server {
listen 80;
server_name www.mysite.ru;
rewrite ^/(.*) http://mysite.ru$1 permanent;
}

server {
listen 80;
server_name mysite.ru;

access_log /var/log/nginx/maxya.access.log;
error_log /var/log/nginx/maxya.error.log ;

root /var/www/maxya;
index index.php;
#charset utf-8;
gzip_static on;
gzip on;

# some images have no mime type
default_type image/jpeg;

location ^~ /lin/ {
rewrite ^/lin/line_(.*)_beg_(.*)_wmax_(.*)_wcur_(.*)_wmin(.*)\.jpg$ /lin/img.php?line=$1&beg=$2&wmax=$3&wcur=$4&wmin=$5 break;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}
#без этого не работают "чистые ссылки"
#if (!-e $request_filename) {
#rewrite ^/(.*)$ /index.php?q=$1 last;
#}

error_page 404 index.php;

# hide protected files
location ~* .(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(.php)?|xtmpl)$|^(code-style.pl|Entries.*|Repository|Root|Tag|Template)$ {
deny all;
}

location ~* imagecache {
access_log off;
expires 30d;
try_files $uri @drupal;
}

location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|htm|html)$ {
access_log off;
expires 30d;
}

location @drupal {
index index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
error_page 405 = @drupal;

location ~ ^.+.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}

}

[/code]
Subject Author Posted

Помогите переписать .htaccess

maxya August 31, 2010 02:48PM

Re: Помогите переписать .htaccess

maxya August 31, 2010 04:50PM

Re: Помогите переписать .htaccess

maxya August 31, 2010 06:23PM

Re: Помогите переписать .htaccess

maxya August 31, 2010 06:57PM

Re: Помогите переписать .htaccess

big bond September 01, 2010 05:32AM

Re: Помогите переписать .htaccess

Igor Sysoev September 01, 2010 05:58AM

Re: Помогите переписать .htaccess

maxya September 01, 2010 02:54PM

Re: Помогите переписать .htaccess

Igor Sysoev September 01, 2010 03:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 260
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready