Rewrite HTACCESS PUT URL

Asked

Viewed 10 times

0

I’m trying to rewrite the following URL:

meusite.com.br/teste.php para meusite.com.br/new

I created the following rule in HTACCESS

RewriteCond %{REQUEST_URI} ^(.*)/teste.php$
RewriteRule .* https://meusite.com.br/novo [R=301,L]

But when I test directly on my server it does not work, I did some testing on HTACCESS preprocessors and rewrites normally. I ran a test with a simpler rewrite:

Redirect /teste.php https://meusite.com.br/novo

This way it rewrites as expected, but generates the status code 405 by redirecting to a PUT call, if you change this call to GET for example it accepts the rewrite and redirects as expected.

Do you have any suggestions how to change this rule? I searched on the Internet, but found nothing similar

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.