Convert all htaccess files to httpd.conf directives
This post is for the Apache web server, I created a simple script that will do the job. You may use it in Wordpress or in many CMS, surely this script will be useful in a lot of situations. It will help you to increase the speed and security of your site. Requirements: root access.
#! /bin/bash
b=$(find $1 -name .htaccess)
for p in $b; do if [[ -s "$p" ]] ; then a=$(dirname $p); echo \<Directory \"$a\"\>; cat $p; echo; echo \</Directory\>; echo; fi; done
You only have to specify the website directory and it fill search for all .htaccess files in sub-directories, then it will print the directives for the httpd.conf file, you can invoke the script like this:
./script.sh /var/www/html