How to patch your Drupal .htaccess
Have you ever been tired to seek changes in your .htaccess Drupal site with the latest version of Drupal? You should have, if you have modified the file for some reason (e.g. changing the memory limit for image processing) and if you don't know how to use patch and diff command lines.
Actually these are not the only tools. But since I'm using Linux (and lovin' it), I'll tell you how to do that with the tools. Ok, let's begin!
Supposed your site is using Drupal 6.3 and you have modified the .htacccess. Name the file .htaccess.d3.mysite
As you want to migrate to Drupal 6.12, you need to ADD Drupal 6.12 rules to your existing .htaccess (.htaccess.d3.mysite). Let's name Drupal 6.3's and Drupal 6.12's .htaccess as .htaccess.d3 and .htacess.d12. To do this follow the following steps:
diff -u .htaccess.d3 .htaccess.d12 | patch .htaccess.d3.mysite
Diff seeks for differences in the two original .htaccess files. The differences are applied to your site's .htaccess.
This also applies to other files but mostly is useful for opensource projects like Drupal. I suggest you be careful by creating backup .htaccess file of your site first.

Comments
Post new comment