.htaccess import another file with rule

2

I have the following problem, I have an administrative area where redirects can be registered, and these redirects are saved in the database, I currently do the redirection via PHP , but I would like to do this redirection via htaccess . So I'm doing the following I am creating a file called .htaccess2 in the root of my site with those rules that are registered in the database, whenever it makes a change or inserts a new record I re-generate that file. Now my question is how do I import or include this file inside my .htaccess , something like this:

Include .htaccess2

Does anyone know of any way to perform such an operation?

    
asked by anonymous 08.03.2016 / 13:24

1 answer

1

You can not include rules, declarations, definitions, or policies from other files in an .htaccess file. The include directive can not be used within an .htaccess file. The function of a .htaccess file is to act similarly to a block, but to 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 requests or include files / content from other directories by hacking the .htaccess file.

Font

    
08.03.2016 / 13:38