.htaccess import another rule file

Asked

Viewed 61 times

2

Guys, I have the following problem, I have an administrative area where can be registered page redirects, and these redirects are saved in the bank, currently I redirect via PHP, but I would like to proceed to make this redirection via htaccess. So what I’m doing is I’m creating a file called .htaccess2 at the root of my site with these rules that are registered in the database, whenever you make a change or insert a new record i Gero this file again. Now my question is how do I import or include that file within mine .htaccess, something like that:

Include .htaccess2

Does anyone know any way to perform an operation in this style?

1 answer

1


You may not include rules, declarations, definitions, or directives of other files in a .htaccess. file include cannot be used inside a .htaccess. file. htaccess is to act in a similar way to a block , but be self-sufficient and not access things outside the directory itself. In this way, someone who wants to do malicious things will not be able to point out requests or include files / content from other directories hacking the . htaccess file.

Source

  • Then I would have to keep redirecting via php?

  • That, would have to do via php.

Browser other questions tagged

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