htaccess redirect if extension and folder do not match

Asked

Viewed 17 times

-1

I want to have it redirected to my domain if it’s not a. php file or certain folders. php I got it:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule \.(php)$ - [L]
RewriteRule (.*) https://www.exemplo.com/$1 [R=301,L]

1 answer

-1


Done,

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule \.(php)$ - [L]
RewriteRule ^(pasta1|pasta2)($|/) - [L]
RewriteRule (.*) https://www.exemplo.com/$1 [R=301,L]
  • Is this a supplement to the question or is it an answer ? If it is an answer, explain how the problem is being solved and what happened to make it so.

Browser other questions tagged

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