Welcome! Log In Create A New Profile

Advanced

Re: Rewrite except for single uri

August 03, 2009 01:06AM
On Mon, Aug 03, 2009 at 02:45:05PM +1000, Edward Stow wrote:

> Hi
>
> I have a small site that has a buy page with ssl :
> https://shop.abc.tld/buy.html
>
> I want all requests to other pages to be re-directed to http such as
>
> https://shop.abc.tld/index.html --> http://abc.tld/index.html
>
> https://shop.abc.tld/buy.html passes through unchanged
>
> I do not want to have explicitly list the other pages in the rewrite
> as shown for obvious reasons.
> The list has been edited down for brevity.
>
> Any better suggestions.
>
> server
> {
> listen 443;
> server_name shop.abc.tld;
> ssl on;
> ssl_certificate /etc/ssl/certs/shop.abc.tld.crt;
> ssl_certificate_key /etc/ssl/private/shop.abc.tld.key;
>
> access_log /var/log/nginx/abc.tld.access.log;
>
> location /
> #Must be a better way to rewrite
> {
> rewrite ^/(index|about|contact|delivery|refund|privacy|credits)\.html$ http://abc.tld/$1.html
> permanent;
>
> root /srv/www/abc.tld/html;
> index buy.html;
> ssi on;
> }
> }

root /srv/www/abc.tld/html;

location = / {
index buy.html;
ssi on;
}

location = /buy.html {
ssi on;
}

location / {
rewrite ^ http://abc.tld/$request_uri?;
}


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

Rewrite except for single uri

Edward Stow August 03, 2009 12:45AM

Re: Rewrite except for single uri

Igor Sysoev August 03, 2009 01:06AM

Re: Rewrite except for single uri

Edward Stow August 03, 2009 07:22PM

Re: Rewrite except for single uri

Cherife Li August 03, 2009 11:01PM

Re: Rewrite except for single uri

Ray August 03, 2009 09:39PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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