Recursively edit .htaccess to turn off Apache mod_rewrite

I am currently migrating the webpage for Easy Feed Editor to a new domain (More on that some other time).

Since registration is apparently taking ages, I wanted to make sure that everything is properly set up on the webspaces (Sourceforge Project Web and Bplaced). However, I have mod_rewrite rules that redirect you to the proper 2nd-level domain if you enter subdomain.bplaced.net or subdomain.sourceforge.net:
So I can’t test anything until I turn all these rules off (One .htaccess per directory; No access to httpd.conf).

A clever way to do this is:

find . -name ".htaccess" -print | xargs sed -i 's/RewriteEngine On/RewriteEngine Off/g'

First we find all files named .htaccess and then we feed them to sed one-by-one to do the replacing.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.