Advertisement
Trow_Games

Removendo .php | .html do link

Jun 28th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. link.com/teste.html ou link.com/teste.php
  2.  
  3. Ai você sempre quis deixa-lo assim: link.com/teste
  4.  
  5. Bom para fazer isso você terá que ter o arquivo ".htaccess" (Isso é de servidor Apache. Ex: Hostinger; Não funciona no seu pc! )
  6.  
  7. Abra ele e cole este Código:
  8.  
  9. HTML:
  10. RewriteEngine on
  11. RewriteCond %{REQUEST_FILENAME} !-d
  12. RewriteCond %{REQUEST_FILENAME}\.html -f
  13. RewriteRule ^(.*)$ $1.html
  14.  
  15. PHP:
  16. RewriteEngine on
  17. RewriteCond %{REQUEST_FILENAME} !-d
  18. RewriteCond %{REQUEST_FILENAME}\.php -f
  19. RewriteRule ^(.*)$ $1.php
  20. pronto agora tanto faz acessa-lo como: link.com/teste; quanto link.com/teste.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement