I'm now setting up a weblog site and encountered this problem.

My server is Apache httpd 2.2. In case my weblog pollutes the root directory(htdocs), I created a subdirectory blog. The current state is that I can access the root directory from outside with http://my_ip_address/; it shows It works..

However, when I access the URL http://my_ip_address/blog, the server does not respond. I think there must be something wrong with the configuration. After searching Google, I find .htaccess may be the point, which is missing in the blog directory. Am I on the right track? By the way, what does .htaccess used to do?

Could you please give me a reference as a starting point?


.htaccess is used for setting access to a site. its not what you need - you need to look at mod rewrite rules or vhosts and setting the vhost document root to /var/www/blog

the best starting point, naturally is apache's own docs, which i have linked to

  • You use a lot of those rewrite directives in .htaccess files as well, if they only need to be directory specific, as your link shows. – paradroid Sep 9 '11 at 15:19

.htaccess isn't usually required. It is used for configuration directives that might otherwise need to be put in the httpd.conf file, and is especially useful in cases where you don't have access to the server configuration.

At any rate, that probably isn't your problem. I suggest you review your httpd-error.log to see if the problem might be listed there.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.