To access a particular area of the site, I have to indicate one to three parameters in the URL:
Normal URL:
# aceder a um módulo
http://www.meusite.com/index.php?mod=john
# aceder a um sub-módulo:
http://www.meusite.com/index.php?mod=john&call=doe
# Aceder a um conteúdo específico no sub-módulo:
http://www.meusite.com/index.php?mod=john&call=doe&id=1
Through htaccess, I am trying to allow access to specific modules, sub-modules and content as follows:
# aceder a um módulo
http://www.meusite.com/john
# aceder a um sub-módulo:
http://www.meusite.com/john/doe
# aceder a um conteúdo específico no sub-módulo:
http://www.meusite.com/john/doe/1
So far I have the following:
The code below allows me to access the module, but I have to repeat it for each existing module, and still have submodules and specific contents missing:
# Rewrite the url
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond $0 ^john/
RewriteRule ^([^/]*)/([^/]*)$ /index.php?mod=john [NC,L]
RewriteCond $0 ^jane/
RewriteRule ^([^/]*)/([^/]*)$ /index.php?mod=jane [NC,L]
</IfModule>
Question
How do I get through .htaccess
to read the addresses so that they can be used in both ways on top given the three possible parameters?