On http://drupal.org/upgrade/downloading-drupal-command-line, it says to copy .htaccess from the backup of the old site into your new site. The problem with this is that the newer version of Drupal may have introduced additional items in .htaccess that are also required. For example, 4.7 added tpl.php to the list of file types that are blocked (see http://drupal.org/node/58647). If you copy over the old .htaccess, you'll lose this bug fix.
Unfortunately, I don't think there's a simple way of dealing with this. The most reliable approach would be to compare your backup .htaccess to a pristine copy for the same version. If there are no differences, then just use the new version, and don't copy the one from the backup. If there are differences, then edit those differences into the new version. This approach assumes some expertise in .htaccess configuration.
A simpler approach might be to just copy the section from the old into the new, replacing the corresponding section in the new one. This assumes that the index.php?q syntax is here to stay, so that there won't be any changes to this part of .htaccess on the Drupal side of things. It also assumes there are no local changes to the rest of the file. This is based on the idea that commonly the only thing changed locally in .htaccess is the RewriteBase line, and that anyone who has changed any other part of the file knows what they're doing.
Perhaps someone can come up with a better solution, though I suspect .htaccess will be a pain forever.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | UPGRADE.txt_1_0.patch | 868 bytes | pcwick |
| #2 | UPGRADE.txt_0_0.patch | 1.48 KB | pcwick |
Comments
Comment #1
cog.rusty commentedAs you said, someone who has modified .htaccess should know what they are doing. So, a short reminder should be safe enough. Something like:
"*** If your have made any required changes to your existing .htaccess file, remember to keep a note and add them to the new one."
Comment #2
pcwick commentedChanged from Documentation -> Drupal Project because similar patches have been posted there.
Changed Title for consistency with similar patches.
At first I thought it might be best to leave out any reminder about modified files such as .htaccess. However, I know of a case in which users will modify .htaccess without understanding what they are doing. Dreamhost provides instructions for making a simple cut and paste modification to .htaccess because "Drupal's initial settings can prevent access to your Dreamhost stats." http://wiki.dreamhost.com/index.php/Drupal#7._Edit_Your_.htaccess_File
I'm not sure that complicating UPGRADE.txt with a modified files reminder is justified. If so, the attached patch is one possible way to do so.
Comment #3
pcwick commentedThis alternative eliminates any reminders about modified files such as .htaccess
Comment #4
pcwick commentedComment #5
mfer commentedTo be consistent in this file and still remind those who have made changes it would be good to have a not pointing out that changes made to the .htaccess file and/or their robots.txt file need to be moved over to the new install.
Comment #6
mdupontFixed in Drupal 6, where it reads