Welcome! Log In Create A New Profile

Advanced

NGINX redirection issue

August 06, 2014 11:37PM
Hello All,

I am facing some issue regarding nginx redirection. I want to remove .html extension from all the html pages and all the index.html pages. For example

1.
http://www.aaa.com/bbb/ccc.html should show the content of http://www.aaa.com/bbb/ccc.html but the URL should show http://www.aaa.com/bbb/ccc

2. http://www.aaa.com/index.html should show the content of http://www.aaa.com/index.html but the URL should show http://www.aaa.com.

There are few rewrites already there which are given below

1. Whenever you try to access the http://www.aaa.com site, it will redirect to http://www.aaa.com/aaa/bbb/ccc/ddd/index.html.
http://www.aaa.com -----> http://www.aaa.com/aaa/bbb/ccc/ddd/index.html.
2. All directory lookups to 'index.html'
rewrite ^(.*)/$ $1/index.html permanent;
3. All open strings to index.html
rewrite ^(.*)/([^\.\?/]+)$ $1/$2/index.html permanent;

Now whenever I try to implement the change, the site went into a redirect loop and gives following error in the error log.

2014/08/05 14:48:03 [error] 10392#0: *750 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 1.1.1.1, server: www.aaa.com, request: "GET /aaa/ccc HTTP/1.1", host: "www.aaa.com"

Please suggest how to solve the issue

--Manish
Subject Author Posted

NGINX redirection issue

manish-ezest August 06, 2014 11:37PM

Re: NGINX redirection issue

Maxim Dounin August 07, 2014 04:06AM

Re: NGINX redirection issue

manish-ezest August 07, 2014 12:02PM

Re: NGINX redirection issue

manish-ezest August 08, 2014 06:01AM

Re: NGINX redirection issue

Maxim Dounin August 08, 2014 10:52AM

Re: NGINX redirection issue

manish-ezest August 08, 2014 10:49PM

Re: NGINX redirection issue

Maxim Dounin August 09, 2014 09:12PM

Re: NGINX redirection issue

manish-ezest August 29, 2014 04:05AM

Re: NGINX redirection issue

Maxim Dounin August 30, 2014 10:48PM

Re: NGINX redirection issue

manish-ezest September 01, 2014 02:05PM

Re: NGINX redirection issue

Maxim Dounin September 02, 2014 10:00AM

Re: NGINX redirection issue

manish-ezest September 03, 2014 03:53AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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