Welcome! Log In Create A New Profile

Advanced

Re: Rewrite or internal redirection cycle?

António P. P. Almeida
June 15, 2011 10:48AM
On 15 Jun 2011 15h33 WEST, appa@perusio.net wrote:

> On 15 Jun 2011 14h11 WEST, nginx-forum@nginx.us wrote:
>
>> I get the same problem with TECK The difference is my homepage is
>> work well, but when I tried to click a link on my homepage, it's
>> get me 500 Internal Server Error.
>>
>> Here my configuration:
>
> Your configuration suffers from a lot of mod_rewrite influenced
> thinking. As Igor calls it, it's a Yoda style of configuration.
>
>
> This makes no sense. You're doing a capture that you don't use and
> you seem to be rewriting to the same URI.
>
>> if (-f $document_root/maintenance.html) {
>> rewrite ^(.*)$ /maintenance.html last;
>> break;
>> }
>
> location = /maintenance.html { }
>
> location / {
> try_files $uri $uri/ /index.php?q=$uri&$args;
> }
>
> location /administrator/ {
> rewrite ^ https://www.domain.com$request_uri? permanent;
> }
>
> location ~* com_login {
> rewrite ^ https://www.domain.com$request_uri? permanent
>
> }
>

This can be made simpler I believe. Just

location /en/(.*)$ {
index index.php;
try_files $uri $uri/ /en/index.php?$1;
}

should do the trick. Try it.

Also you'll need to create another location for = /en/index.php.

location = /en/index.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi_params;
}

--- appa



_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewrite or internal redirection cycle?

TECK May 19, 2011 09:20AM

Re: Rewrite or internal redirection cycle?

Igor Sysoev May 20, 2011 01:36AM

Re: Rewrite or internal redirection cycle?

TECK May 20, 2011 02:40PM

Re: Rewrite or internal redirection cycle?

muhfiasbin June 15, 2011 09:11AM

Re: Rewrite or internal redirection cycle?

SplitIce June 15, 2011 09:24AM

Re: Rewrite or internal redirection cycle?

António P. P. Almeida June 15, 2011 10:38AM

Re: Rewrite or internal redirection cycle?

António P. P. Almeida June 15, 2011 10:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 247
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