Welcome! Log In Create A New Profile

Advanced

Re: redirect url in nginx

November 27, 2013 02:46PM
rewrite /poczatek(.*) $scheme://$host$uri/index.php?cat=poczatek
permanent;

*should* work. I've not used rewriites with gets though...

Steve

On Wed, 2013-11-27 at 20:18 +0100, Marcin Kasiński wrote:
> Hello,
>
>
>
> I have a problem with redirect url in nginx.
>
>
>
> I want to redirect http://almelle.atmserv.pl/poczatek na
> http://almelle.atmserv.pl/index.php?cat=poczatek
>
>
>
> In vhost conf file I have:
>
>
>
> server {
>
> listen 80; ## listen for ipv4; this line is default and
> implied
>
> # listen [::]:80 default_server ipv6only=on; ## listen for
> ipv6
>
>
>
> server_name almelle.atmserv.pl;
>
> rewrite_log on;
>
>
>
>
>
>
>
> root /usr/share/nginx/www/almelle.atmserv.pl;
>
> index index.php index.html,index.htm;
>
> # server_name almelle.atmserv.pl;
>
> # rewrite_log on;
>
>
>
> access_log /var/log/nginx/almelle.atmserv.pl.access.log;
>
>
>
> # try_files $uri $uri/ @rewrite;
>
>
>
> error_page 404 /404.html;
>
>
>
> error_page 500 502 503 504 /50x.html;
>
>
>
>
>
>
>
> location = /50x.html {
>
> root /usr/share/nginx/www;
>
> }
>
>
>
>
>
> location ~ \.php$ {
>
> try_files $uri = 404;
>
> fastcgi_pass unix:/var/run/php5-fpm.sock;
>
> fastcgi_index index.php;
>
> fastcgi_param SCRIPT_FILENAME $document_root
> $fastcgi_script_name;
>
> include fastcgi_params;
>
> }
>
>
>
> # location @rewrite {
>
> #
>
> # rewrite ^/(.*)$ /index.php?cat=$1;
>
> #
>
> # }
>
>
>
> location /poczatek {
>
>
>
> rewrite ^/(.*)
> http://almelle.atmserv.pl/index.php?cat=poczatek permanent;
>
>
>
> }
>
>
>
> }
>
>
>
> Please, help me…
>
>
>
> Thanks…
>
>
>
>
>
> Marcin Kasiński
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

--
Steve Holdoway BSc(Hons) MIITP
http://www.greengecko.co.nz
Linkedin: http://www.linkedin.com/in/steveholdoway
Skype: sholdowa

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

redirect url in nginx

Marcin Kasiński November 27, 2013 02:20PM

Re: redirect url in nginx

GreenGecko November 27, 2013 02:46PM

Re: redirect url in nginx

António P. P. Almeida November 27, 2013 02:50PM

Re: redirect url in nginx

António P. P. Almeida November 27, 2013 02:50PM

Re: redirect url in nginx

Marcin Kasiński November 28, 2013 07:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 200
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready