4 replies [Last post]
ProfitProphet's picture
Offline
Joined: 08/23/2007
Juice: 29
Was this information Helpful?

Hey guys,

I'm trying a clean install of Drupal on a test site. This is my first time using Drupal.

Do I need to replace the .htaccess file that is in the root of my site with the one that comes with Drupal?

I'm putting Drupal in it's own directory and I'm not sure if the .htaccess file will make a difference there or if it needs to be in the root.

Thanks!

Andy's picture
Offline
Administrator
Joined: 08/07/2007
Juice: 1076
.htaccess files

You do NOT want to move the .htaccess file up to the root directory. I am not certain, but I believe you will have serious issues if you do. In theory the .htaccess file in your Drupal directory will override the one in the root directory.

As a side note, Do you have access to your web server's httpd.conf file? If you do, you can put the contents of your .htaccess files into "" blocks in the httpd.conf so that you have one place to administer these files. Also you can then disable .htaccess files and get a performance boost. This is because the web server has to do a disk seek for every directory level for every file served if .htaccess is enabled. For example. If a user requests a file stored at /var/www/html/vhost.com/specials/greatdeal.html and .htaccess files are enabled, then Apache checks for the existence of each of the following files:
/.htaccess
/var/.htaccess
/var/www/.htaccess
/var/www/html/.htaccess
/var/www/html/vhost.com/.htaccess
/var/www/html/vhost.com/specials/.htaccess
read more here: http://httpd.apache.org/docs/1.3/howto/htaccess.html#when
Sorry, a bit more then you asked for.
Peace,
Andy

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: .htaccess files

I did not know that. Thanks for posting it, Andy.

*plans to make changes to dedicated box on Monday*

--
Help directly fund development: Donate via PayPal!

ProfitProphet's picture
Offline
Joined: 08/23/2007
Juice: 29
Re: .htaccess files

Thanks a lot Andy!

Unfortunately I am on shared hosting and don't have access to the httpd.conf file. If I go dedicated in the future I will mos def keep this in mind.

druru's picture
Offline
Brain Stormer
Joined: 08/08/2007
Juice: 228
Re: .htaccess files (n00b drupal question)

andy is right. move it to your httpd.conf if you know what you're doing.

remember to delete or rename the original .htaccess after you make the changes!

and restart apache so the changes take place.