Welcome! Log In Create A New Profile

Advanced

Re: Permanent redirection with regex after moving blog

August 12, 2009 05:17PM
[quote]this rewrite looks ok, could you show whole server{} config?[/quote]

Thanks for asking - I have pasted it below.

Before that: I just realized that

location /weblog/ { rewrite ^/(.*)$ /blog/$1 permanent; }

was actually not even giving me the root of /blog/ (I had left in the old
statement as well). It actually returns:

/blog/weblog

which is a 404.

Anyway, on to the server statements in nginx.conf:



server {
server_name www.tinyapps.org;
rewrite ^/(.*) http://tinyapps.org/$1 permanent;
}

server {
server_name tinyapps.org;
root (root path is displayed here)
autoindex on;

location = /favicon.ico { return 204; }
location = /robots.txt { return 204; }
location /vnc { rewrite /vnc /docs/vnc/ permanent; }
location /weblog/ { rewrite ^/(.*)$ /blog/$1 permanent; }
location /docs.html { rewrite /docs.html /docs/ permanent; }
location /ftp.html { rewrite /ftp.html /docs/ftp.html permanent; }
location /not_yours_to_give.html { rewrite /not_yours_to_give.html /docs/not_yours_to_give.html permanent; }
location /quotes.html { rewrite /quotes.html /docs/quotes.html permanent; }
location /search_tips.html { rewrite /search_tips.html /docs/search_tips.html permanent; }
location /treo_600.html { rewrite /treo_600.html /docs/treo_600.html permanent; }
location /aid4mail { rewrite /aid4mail /docs/aid4mail/ permanent; }
location /drive_snapshot_review { rewrite /drive_snapshot_review /docs/drive_snapshot_review/ permanent; }
location /freenx { rewrite /freenx /docs/freenx/ permanent; }
location /poems { rewrite /poems /docs/poems/ permanent; }
location /virtualpc { rewrite /virtualpc /docs/virtualpc/ permanent; }
location /blog/atom.xml { rewrite /blog/atom.xml /blog/index.rss20 permanent; }
location = /blog/index.rss { rewrite ^ /blog/index.rss20 permanent; }
location = /blog/index.atom { rewrite ^ /blog/index.rss20 permanent; }
}
Subject Author Posted

Permanent redirection with regex after moving blog

miles August 12, 2009 04:42PM

Re: Permanent redirection with regex after moving blog

meto August 12, 2009 05:00PM

Re: Permanent redirection with regex after moving blog

miles August 12, 2009 05:07PM

Re: Permanent redirection with regex after moving blog

meto August 12, 2009 05:09PM

Re: Permanent redirection with regex after moving blog

miles August 12, 2009 05:17PM

Re: Permanent redirection with regex after moving blog

Igor Sysoev August 13, 2009 03:12AM

Re: Permanent redirection with regex after moving blog

miles August 13, 2009 03:55AM

Re: Permanent redirection with regex after moving blog

Nick Pearson August 12, 2009 05:07PM

Re: Permanent redirection with regex after moving blog

miles August 12, 2009 05:33PM

Re: Permanent redirection with regex after moving blog

Igor Sysoev August 13, 2009 03:10AM

Re: Permanent redirection with regex after moving blog

miles August 13, 2009 03:54AM

Re: Permanent redirection with regex after moving blog

Marcus Clyne August 13, 2009 05:43AM

Re: Permanent redirection with regex after moving blog

Igor Sysoev August 13, 2009 06:20AM

Re: Permanent redirection with regex after moving blog

Marcus Clyne August 13, 2009 09:05AM

Re: Permanent redirection with regex after moving blog

Igor Sysoev August 13, 2009 09:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 65
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready