Drupal with friendly URLs Gotcha

The following is a Quick Summary of what I did do get Drupal Friendly URL's running correctly when on a Mac Leopard and running drupal out of a user Sites folder.
I am currently developing a relatively complicated drupal site that is running on a remote server.  Because we have some data-entry for content going on, I don't want my development to impact the users, so did an SCP of the whole site down to my local Mac Leopard machine.
I put the drupal directory into my local "Sites" directory, that is, /Users/prhodes/Sites/myproject
I then went to my drupal site at http://localhost/~prhodes/myproject/, and it loaded, however, clicking any link resulted in a 404.  Friendly URL's are broken.

  1. Edit the .htaccess file in your drupal directory and find the "RewriteBase" line in this file, and either add a new one, or uncomment one and fix it to read  RewriteBase /~prhodes/myproject/
  2. Edit your user apache configuration file to allow overrides via an .htaccess file.  If you do not do this, your .htaccess file will be ignored.  I commented out the following line:  ##    AllowOverride None in /etc/apache2/users/prhodes.conf  Please  note, you will have to sudo to do this.
  3. Edit your master apache configuration file.  Comment out the "AllowOverride None" for the directory "/"
  4. Restart your apache server instance.
  5. Friendly URLs work now!

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options