Friends, good afternoon. I'm trying to create a nice .htaccess days, but we're having some difficulties.
Here are examples of what I need, remembering that everything needs to be on the same URL.
1) Whenever the user accesses the web site I want to add a "/ home /" at the end of the URL.
Antes: http://app.meusite.com/
Depois: http://app.meusite.com/home/
2) I want all URLs to be removed or ".php".
Antes: http://app.meusite.com/login.php
Depois: http://app.meusite.com/login/
3) I want all URLs to be as follows:
Before:
http://app.meusite.com/usuario-adicionar.php
http://app.meusite.com/usuario-editar.php
http://app.meusite.com/usuario-excluir.php
Then:
http://app.meusite.com/usuario/adicionar/
http://app.meusite.com/usuario/editar/
http://app.meusite.com/usuario/excluir/
Only one comment to be taken into consideration ...
Because the whole site is multi-lingual, I need all pages to accept the get parameter which will be LANG = LANGUAGE (eg lang = en_US)
Then all of the above URLs should accept the GET parse too, and would like it to look like this:
http://app.meusite.com/index.php?lang=en_US
http://app.meusite.com/home/en_US/
http://app.meusite.com/login.php?lang=en_US
http://app.meusite.com/login/en_US/
http://app.meusite.com/usuario-adicionar.php?lang=en_US
http://app.meusite.com/usuario/adicionar/en_US/
http://app.meusite.com/usuario-editar.php?lang=en_US
http://app.meusite.com/usuario/editar/en_US/
http://app.meusite.com/usuario-excluir.php?lang=en_US
http://app.meusite.com/usuario/excluir/en_US/
How do I do:
Options -MultiViews
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^home\/?(.*)\/?$ index.php?lang=$1 [L]
RewriteRule ^([^/]*)\/?(.*)\/?$ $1.php?lang=$2 [L]
RewriteRule ^([^/]*)\/([^/]*)\/([^/]*)\/?$ $1-$2.php?lang=$3 [L]
I hope you can understand my question.
Right now, thank you very much.
Hugs!