Problems with rewriterule in htaccess Similar URLs

0

I have two URLs

link

link

They are different URLs that lead to different .php files, so I did so my htaccess:

RewriteRule ^entre-em-contato entre-em-contato.php
RewriteRule ^en antigo-en.php

But both URLs are leading to the file antigo-en.php

I tried to flip as I read this post :

RewriteRule ^en antigo-en.php
RewriteRule ^entre-em-contato entre-em-contato.php

But both continue to redirect to antigo-en.php

What to do?

    
asked by anonymous 17.01.2018 / 15:04

1 answer

1

Your rule is not correct, you should mark the beginning using the (^) character and the end of the ($) expression as below:

RewriteRule ^odata/entre-em-contato$ entre-em-contato.php [L]

The expression above translating in general says that the url that contains after the domain that in your case is localhost , odata preceded by in-between -contact will be forwarded to the file in the root between-in-contact.php

RewriteRule ^odata/en$               antigo-en.php        [L]

The url containing odata preceded by en will be routed to the old-en.php

The [L] is last, ie in a list of conditions, the conditions below the one with this flag will not be read.

    
19.01.2018 / 03:55