Don't leave behind .htaccess

When copying the files of a Drupal install, do not forget to copy Drupal's .htaccess file. If you've had the vexing problem where a site you've just manipulated has clean URLs turned on but they suddenly don't work, this may well be the reason. It took me fixing this problem many times before I realized what was going on.


You make a directory for a new site, cd to the new directory, and use drush to download Drupal.

% mkdir mynewsite
% cd mynewsite
% drush dl drupal

Now, you do an ls command and notice that drush put the files in a subdirectory of the current directory.

% ls -F


"No, problem," you think, you will just move those files up a level. So you

cd to the directory and copy the files up a level.

% cd drupal-6.20
% mv * ..

The Problem

You think you copied all the files up a level, but the Unix wildcard "*" does not match .htaccess so you left the .htaccess file behind in the subdirectory. Your out-of-the box Drupal site is not going to work right without it (once you connect it properly to a blank database).

The Proof

If you still do not believe that you left behind the .htaccess do an ls -a to check. You think there is nothing left in this directory but...

% ls -a

.		..		.htaccess

The easiest thing is to recognize that it was left behind and do another command

% mv .htaccess ..

Then clean up with

% cd ..
% rm -r drupal-6.20


Strange but true, the Unix wildcard "*" does not match hidden files, whose names begin with ".". But the file >.htaccess is important to most Drupal installs, do not leave it behind when manipulating a site to switch hosting, or whatever. I'm pretty sure that there are other ways, with various file-handling GUIs to leave behind the hidden ".htaccess" fille. So, whatever tools you use to manipulate, move, or copy a site's files, just make sure that .htaccess gets the same treatment as all the other files.


CMS Complexity


I know what you mean. There is tremendous amount of complexity in any web site so basing a given site on the simplest framework that can do the job, makes sense. I agree that Drupal is not called for in many projects.

But when you need its flexibility you really need Drupal. You generally need to add design/engineering time to limit the choices presented to users of your system. That leaves lots of work for Drupalists, like me, who specialize in back-end development.

With Drupal I can build just

With Drupal I can build just everything - personal blogs or enterprise applications, but sometimes it seems to me to be too difficult to understand and to work with. There are numerous adds that are useful when building sites. What is more attractive for me and as I think for many other users It's absolutely free)))) but as I told it's hard to remember about everything, I always forget about this file(((

Drupal SEO