Information


Subdomains that Work Independently From Drupal

If you have Drupal installed in your main directory (i.e. public_html), and you want to use subdomains for webpages or websites that have nothing to do with Drupal, you may have noticed that they don’t work!

The problem is that the .htaccess file in the public_html folder is set up to assume that the default index file is index.php. What you probably want is to have index.htm and index.html recognized as the default file when your visitors browse to sub.domain.com

The solution is simple:

  1. Create an .htaccess file in the subdomain folder (e.g. public_html/sub)
  2. Add the following line to the .htaccess file: “DirectoryIndex index.php index.htm index.html ” Add “index.php” as well if you think you might ever use php in the subdomain as part of your index file.
  3. And you are done!

Now, when you go to sub.domain.com, your index.html or index.htm should get served up.

Thanks to CogRusty for his solution on the Drupal Support Forum for the solution.


Comments

No comments:

There are no comments for this post so far.

Post a comment