leave / at the end of the url

2

I would like to hide the .php extension of the site from all pages and stick with the slash at the end example: www.meusite.com.br/pagina/

I would also like to hide pages that are like landing pages , which are like this: www.meusite.com.br/lp/br/rj/exemplo.php

It would look like this: www.meusite.com.br/exempo/ (obs: would hide lp/br/rj/ )

Can anyone help?

    
asked by anonymous 08.07.2015 / 00:51

1 answer

1

This is more than leaving / at the end and removing .php . You can try something like this Hide domain directory using htaccess or router in cakephp

I believe that your .htaccess would look like this:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteBase /
   RewriteRule ^(?!lp/br/rj/)(.*)/$ lp/br/rj/$1.php [QSA,L]
</IfModule>

If you want the address http://exemplo.com/contato and http://exemplo.com/contato/ to access the same php file, use the following:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteBase /
   RewriteRule ^(?!lp/br/rj/)(.*)(/|)$ lp/br/rj/$1.php [QSA,L]
</IfModule>
    
08.07.2015 / 01:23