How to patch your Drupal .htaccess

in

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

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <pre> <i>
  • Lines and paragraphs break automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter OPTIONS}...{/syntaxhighlighter} tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.