Skip to content

Instantly share code, notes, and snippets.

@profburnes
Created September 27, 2017 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save profburnes/479b17dc521df1438b0fb691b3813848 to your computer and use it in GitHub Desktop.
Save profburnes/479b17dc521df1438b0fb691b3813848 to your computer and use it in GitHub Desktop.
Exemplo simples de .htaccess para URL Amigáveis
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?param=$1
@theLeonardoLima
Copy link

Boa! talvez seja necessário usar a condição If para verificar se este módulo Rewrite está ativado!

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^inicio/?$ /index.php [NC,L]
    
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?param=$1
</IfModule>

Fonte: http://www.linhadecodigo.com.br/artigo/3555/aprendendo-urls-amigaveis.aspx#ixzz7pMFd91tm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment