Disable Apache mod_rewrite Rules in any Subdirectory

Let’s say you have some .htaccess rewrite rules in place using Apache’s mod_rewrite. By default if the rewrite rules are located in the root directory, they will be applied to every subdirectory, as expected. But what if you need to disable the rewrite rules so that they do not affect some specific sub-directory or sub-folder? This super quick tutorial shows the easiest way to do it. Don’t blink.. Ready? Here it is: RewriteEngine off Create a new .htaccess file in […]


This content originally appeared on Perishable Press and was authored by Jeff Starr

Let’s say you have some .htaccess rewrite rules in place using Apache’s mod_rewrite. By default if the rewrite rules are located in the root directory, they will be applied to every subdirectory, as expected. But what if you need to disable the rewrite rules so that they do not affect some specific sub-directory or sub-folder? This super quick tutorial shows the easiest way to do it.

Don’t blink..

Ready? Here it is:

RewriteEngine off

Create a new .htaccess file in the subdirectory where you want to turn off mod_rewrite, and then add the above line of code. Done.

For example, I use this technique to disable the 7G Firewall in a custom directory used for testing new patterns and so forth. Whatever the mod_rewrite rules you have in place higher up the chain, the above line will disable them in any subfolder.

Related



This content originally appeared on Perishable Press and was authored by Jeff Starr


Print Share Comment Cite Upload Translate Updates
APA

Jeff Starr | Sciencx (2021-03-26T19:03:56+00:00) Disable Apache mod_rewrite Rules in any Subdirectory. Retrieved from https://www.scien.cx/2021/03/26/disable-apache-mod_rewrite-rules-in-any-subdirectory/

MLA
" » Disable Apache mod_rewrite Rules in any Subdirectory." Jeff Starr | Sciencx - Friday March 26, 2021, https://www.scien.cx/2021/03/26/disable-apache-mod_rewrite-rules-in-any-subdirectory/
HARVARD
Jeff Starr | Sciencx Friday March 26, 2021 » Disable Apache mod_rewrite Rules in any Subdirectory., viewed ,<https://www.scien.cx/2021/03/26/disable-apache-mod_rewrite-rules-in-any-subdirectory/>
VANCOUVER
Jeff Starr | Sciencx - » Disable Apache mod_rewrite Rules in any Subdirectory. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/03/26/disable-apache-mod_rewrite-rules-in-any-subdirectory/
CHICAGO
" » Disable Apache mod_rewrite Rules in any Subdirectory." Jeff Starr | Sciencx - Accessed . https://www.scien.cx/2021/03/26/disable-apache-mod_rewrite-rules-in-any-subdirectory/
IEEE
" » Disable Apache mod_rewrite Rules in any Subdirectory." Jeff Starr | Sciencx [Online]. Available: https://www.scien.cx/2021/03/26/disable-apache-mod_rewrite-rules-in-any-subdirectory/. [Accessed: ]
rf:citation
» Disable Apache mod_rewrite Rules in any Subdirectory | Jeff Starr | Sciencx | https://www.scien.cx/2021/03/26/disable-apache-mod_rewrite-rules-in-any-subdirectory/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.