You are here

Add new comment

Multiple Weblogs and .htaccess

I have one main weblog which is the main page on my site, with other weblogs in subdirectories. I wanted users to be able to access each weblog by requesting only "mydomain.com" or "mydomain.com/OtherWeblog" without the need for direct reference to a specific file.

A problem I had was that the weblog software is not permitted to write into the root directory. This means that a request for "mydomain.com" needs to be redirected to the directory with the main weblog.

I have achieved this with a directive in the .htaccess file. This tells the server to use a different index.html file than the one in the requested directory.

This also means that a request for any other directory will also be redirected to the same file, unless that subdirectory also contains a .htaccess file with the directive "DirectoryIndex /thisDirectory/index.html".

Relevant documentation can be found at apache.org here or here at interland or here at homelinux.com , the latter also has some useful ideas for blocking unwelcome bandwidth consuming bots.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer