htaccess constraints

6

I would like to clean my url so the user will not see it, I searched the internet but could not get it to work.

I've already activated the bookstores in my wamp but could not get it to work properly.

www.meusite.com.br/index.php?p=contact&username=trabalhe

I need to keep the entire structure but I would like the client to just view :

www.mysite.com / contact / work

How can I do this?

I did some testing and came up with the following source:

.htaccess

#reescrita
RewriteRule ^([a-z,0-9,A-Z,_-]+)\/([a-z,0-9,A-Z,_-]+)\/$ index.php?p=$1&assunto=$2 [NC,L]

html

<a href="pagina/teste/">action</a>
<a href="pagina2/teste2/">action2</a>

But when I click on the second link option it does not clear url, it only increments showing error, how to fix?

www.pagina.com.br/pagina2/teste2/pagina/teste /

    
asked by anonymous 17.12.2015 / 11:47

1 answer

2

The problem is that your href is thus (relative to path current):

pagina/teste/

It should look like this:

/pagina/teste/
    
17.12.2015 / 16:33