NGINX: 301 reescreve

2

Eu tenho uma lista de 301 reescritas para definir no Nginx. E eu quero especificar exatamente o uri em vez de usar o regex. Qual é a maneira de escrever isso?

Isso é o que eu acho que deve ser feito:

rewrite /o-atipico /rogerio-madureira.htm permanent;
rewrite /CHANGELOG.txt / permanent;
rewrite /MaxLucado / permanent;
rewrite /adwords / permanent;
rewrite /animals.txt / permanent;
rewrite /apresentacao / permanent;
rewrite /arquivos / permanent;
rewrite /atipico / permanent;
rewrite /atipico.com.br / permanent;
rewrite /baix / permanent;
rewrite /baixe.asp / permanent;
rewrite /blog / permanent;
rewrite /c / permanent;
rewrite /calendario.asp / permanent;
rewrite /capture.asp / permanent;
rewrite /contato / permanent;
rewrite /contato.asp / permanent;
rewrite /conteudo.asp / permanent;
rewrite /cu / permanent;
rewrite /cur / permanent;
rewrite /curs / permanent;
rewrite /curso / permanent;
rewrite /curso.asp / permanent;
rewrite /cursoempresa.asp / permanent;
rewrite /cursoindividual.asp / permanent;
rewrite /cursoonline.asp / permanent;
rewrite /cursopresencial.asp / permanent;
rewrite /empreendedor / permanent;
rewrite /empresário / permanent;
rewrite /error_log / permanent;
rewrite /exemplo-de-codifo-semantico.html / permanent;
rewrite /favicon.bmp / permanent;
rewrite /function.file-put-contents / permanent;
rewrite /function.getimagesize / permanent;
rewrite /function.include / permanent;
rewrite /galeria.html / permanent;
rewrite /google / permanent;
rewrite /home.htm / permanent;
rewrite /home.xsl / permanent;
rewrite /hospedagem-de-sites / permanent;
rewrite /i / permanent;
rewrite /ideias-em-curso.php / permanent;
rewrite /index.php5 / permanent;
rewrite /inex.htm / permanent;
rewrite /ivar.html / permanent;
rewrite /marketing.htm / permanent;
rewrite /matricula.asp / permanent;
rewrite /me / permanent;
rewrite /muieblackcat / permanent;
rewrite /natal / permanent;
rewrite /news / permanent;
rewrite /news.html / permanent;
rewrite /obrigado / permanent;
rewrite /overview.asp / permanent;
rewrite /pagina.html / permanent;
rewrite /palestra / permanent;
rewrite /participe.asp / permanent;
rewrite /performance-de-sites / permanent;
rewrite /pesquisa.htm / permanent;
rewrite /prodo / permanent;
rewrite /prodo.asp / permanent;
rewrite /promocao. / permanent;
rewrite /promocao.asp / permanent;
rewrite /promoparti.asp / permanent;
rewrite /propaganda-e-anuncios-de / permanent;
rewrite /r / permanent;
rewrite /results.aspx / permanent;
rewrite /robost.txt / permanent;
rewrite /robots.txt / permanent;
rewrite /seo / permanent;
rewrite /shorinji / permanent;
rewrite /sites / permanent;
rewrite /sualoja.asp / permanent;
rewrite /teste.htm / permanent;
rewrite /treinamento-de-marketing.htm / permanent;
rewrite /treinamento-de-seo.htm / permanent;
rewrite /treinamento-de-vendas.htm / permanent;
rewrite /treinamentos.asp / permanent;
rewrite /vcard / permanent;
rewrite /vendas / permanent;
rewrite /vendas.htm / permanent;
rewrite /vendedor / permanent;
rewrite /xml.asp / permanent;

É a melhor maneira de fazer isso?

Obrigado.

    
por Roger 19.10.2011 / 18:37

1 resposta

2

Eu usaria o mapa para fazer isso.
Possivelmente, também coloque os mapeamentos em um arquivo diferente e inclua-o.
Realiza o mesmo, mas é - na minha opinião - mais fácil de ler.

Veja: link
O segundo exemplo é basicamente o que você quer fazer.

    
por 19.10.2011 / 20:24