Link directing wrongly with htacess

1

I'm using the following structure in addresses / links to my friend's url on fixed pages:

RewriteRule ^teste(.*)$ teste.php  

So, my address looks like this: www.site.com/teste
It happens that if the user enters the word test next to another term, the site finds the same way, being that should send to the page of error 404 ..
Ex: www.site.com/teste123
With the above link typed, it redirects to the test page normally ..

    
asked by anonymous 22.12.2015 / 13:41

1 answer

2

If you want to only work teste , you can not have .* .

RewriteRule ^teste$ teste.php

If you want the URL to accept more things, separated by slashes, you can use this:

RewriteRule ^teste(/.*)*$ teste.php
    
22.12.2015 / 16:26