Download - URL Amigáveis com Apache mod_rewrite
![Page 1: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/1.jpg)
![Page 2: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/2.jpg)
O que é URL Amigável?
![Page 3: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/3.jpg)
Url Amigável - Friendly URL
• Compreensível
• Simples
• Melhor Indexável
![Page 4: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/4.jpg)
Alguns Exemplos
![Page 5: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/5.jpg)
http://www.seudominio.com/noticia.php?id=12&categoria=3
http://www.dominiotal.com.br/Main#Profile?rl=fpp&uid=6398776078809316644
http://over.parperfeito.com.br/servlet/Login?redirect=/servlet/ProfileViewer?b6bbc2cec6cbcecdcec8c6d9bebcabb6b0b1c2b3b0b8b6b1d1acb7b0a8afadb0b9b6b3bad98c979088ac969891c28b8d8a9a&utm_campaign=cupido_semfoto&utm_source=cupido_ParPerfeito&utm_medium=email&orig=37
http://mail.live.com/default.aspx?wa=wsignin1.0
![Page 6: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/6.jpg)
Mais um exemplo tosco
http://www.gianturl.com?NnmnAnFtZJ,K8znP4R3,1GtV3M4V,,,8Z,5lPK8W6QP,L87c7l1d,x2BCYN7fpSP,H,m7t1,0,Bs,0Mc04r,Vvh5TcJ6tnqHJ,8h,7kGbc,9ZF1x6,MDZmS6s5tG0VSb9,M,,M,c1Csc3hnPb,YVvvKwCyt5W0,qMH0Nr8vJQd7qm5mfMsfbMl,3r0JH0PZb,5dq3C9,K0M,,,,3SKS,z,s4jH8gxbF8swbflgfcDC6Z7QjztG6gt6y8x,5wWCGvh6jN1,pl2b,s,lxd2s,4L6Y8hZ5Lk9p,f5skMZL,z0qC,cjmTztZQ,lGc8,1s4TM,,3Tk99jZC,z3,rP5tnqVZt2tF4,LfsK9JB6,1FHR,zP6f3p,3,Lg3vZSr,dn3,,x2sx,q,ZYcbXsVhy3,3tcM,5Lf5sJXl4c,5nqJ,pyQnb1y0VS0K,,t0lj1N8GV6Wxtn,7DTTzx,v4kN0,ct,2bytqrzw,,,7B9Vyxr,2rw0s9jd0,D,,pj3,B7,ls8cQ,Cnnb8w,2T4M6kP1Py4ktm8tjY,,xj1wVH,bjKmwNBMqNh2b6t0JNqZ0Bg70mPHtr6YrD3qxcX,g3,G6hPvgM2PQ6t4,DKLlM8r8,Z4ZJt6vJ,mVpy6Xnc1fvSvgW,,lHkDct0X0sfMK2Bn5gTSl7jm1,,,sshDhv4k7YW9D,h,7,p2N4DT4,npd,5BQQssYr9qT1txd,5,vdb,NxxCna
![Page 7: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/7.jpg)
Agora...
![Page 8: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/8.jpg)
Bons Exemplos
![Page 9: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/9.jpg)
http://g1.globo.com/g1/ciencia/
www.seudominio.com/noticia/31/10/2009
http://noticias.bol.uol.com.br/jogosonline/halloween-bubble.jhtm
![Page 10: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/10.jpg)
Vamos entrar nessa onda...
![Page 11: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/11.jpg)
Pra que implementar isso?
![Page 12: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/12.jpg)
Motivos para implementar
spiders indexam melhor url que não contenham parâmetros
evita vunerabilidade
as urls não serão mudadas se houver mudança na tecnologia
![Page 13: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/13.jpg)
!important;
![Page 14: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/14.jpg)
Reescrita de URL!=
Redirecionamento
![Page 15: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/15.jpg)
Reescrita de Url
Interno ao servidor web
Regra de reescrita (RewriteRule)
Executa um encaminhamento
Entrega ao user Agent
Sem informar nova URL!
![Page 16: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/16.jpg)
![Page 17: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/17.jpg)
Redirecionamento
Recurso disponível em outra url
Avisa ao user agent que está disponível
O user agent aponta a nova url
Acessa o recurso
Processo não transparente!
![Page 18: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/18.jpg)
![Page 19: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/19.jpg)
Vantagens
![Page 20: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/20.jpg)
• Segurança
• Manutenabilidade
• Fácil indexação
• Usabilidade
![Page 21: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/21.jpg)
Desvantagens
![Page 22: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/22.jpg)
![Page 23: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/23.jpg)
Dicas
![Page 24: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/24.jpg)
Não use letras Maiúsculas
![Page 25: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/25.jpg)
Não use Caracteres de Separação
![Page 26: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/26.jpg)
Não faça urls longas
![Page 27: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/27.jpg)
O que precisamos?
![Page 28: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/28.jpg)
servidor apache
modulo Rewrite do apache
um arquivo htaccess
expressões regulares
UMA ESTRATÉGIA
![Page 29: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/29.jpg)
Mãos a obra?
![Page 30: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/30.jpg)
![Page 31: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/31.jpg)
Contatos
![Page 33: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/33.jpg)
Obrigado!
![Page 34: URL Amigáveis com Apache mod_rewrite](https://reader034.vdocuments.pub/reader034/viewer/2022042701/55b3c7b5bb61ebc7548b462b/html5/thumbnails/34.jpg)