Hi, everyone.

I am fairly new to drupal and want to install it for a subdomain.

I have a main domain running a non-drupal based code at www.example.com

I created a subdomain www.test.example.com. All files for this subdomain are placed at htdocs/test.example.com/ subdirectory
I installed Drupal 6.4 into htdocs/test.example.com subdirectory.

I can successfully access the drupal installation script by typing http://www.example.com/test.example.com/, but
when I type http://test.example.com or http://www.test.example.com I get an error 500 inernal Server Error.

I guess this problem has something to do with rewrite rules in .htaccess file, but I cannot figure out how to modify this file
to reach the goal.

Any help?

Thanks in advance.
Oleg Subbotin.
PS. Obvioulsy, I want to keep the main site up and running without any modifications while I am playing with drupal...

Comments

s.daniel’s picture

Have you started/completed the installation under http://www.example.com/test.example.com/ ?
Can you access http://test.example.com/CHANGELOG.txt ?
If not - Can you access http://test.example.com/CHANGELOG.txt after renaming .htaccess to something else?

Can you tell which hosting company you are on?

osubbotin’s picture

Hello.

Yes, I've completed the installation under http://www.example.com/test.example.com/
( the installation script completed without errors and I could access the administration page )

Can you access http://test.example.com/CHANGELOG.txt ?
Yes. I can access this file with and without .htaccess file which comes with the Drupal installation.

Can you tell which hosting company you are on?
... I do not see how this may help.... ipshost.ch

Oleg.

s.daniel’s picture

Yes, I've completed the installation under http://www.example.com/test.example.com/
( the installation script completed without errors and I could access the administration page )

Then I'd try to wipe out the database, reupload drupal and try again directly via http://test.example.com/ (or have you done that in the first place?).

Can you access http://test.example.com/CHANGELOG.txt ?
Yes. I can access this file with and without .htaccess file which comes with the Drupal installation.

How about /update.php ? ( Should look the same as http://drupal.org/update.php )

... I do not see how this may help.... ipshost.ch

Some hosts are known to cause trouble because of .htaccess rules not working propperly ect. (like 1and1 for example)

Before deleting the db go to /sites/default/settings.php and look for $base_url. If you installed drupal through http://www.example.com/test.example.com/ and didn't check via http://test.example.com/ before I could imagine that http://www.example.com/test.example.com/ was set as base_url causing you the headache. Also following rules in .htaccess might be interesting:

# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /

osubbotin’s picture

Hello, everyone.

Before I did all the things below - base_url in the previous installation was empty.

I have partial progress ( after trying numerous things)

I re-uploaded Drupal/recreated the database. There was one small difference: the subdirectory was named "test_site" ( test.example.com
was pointing to this new directory )
Immediately after that:
1. Installation window appears under http://www.example.com/test_site
2. http://test.example.com - 500 Internal error
3. http://test.example.com/CHANGELOG.txt - readable

I completed installation steps using 1.
immediately after that I see the new site under http://test.example.com, but it is broken ( showing only text, but no css formatting/pictures )

After that I changed the base_url to "http://test.example.com"
and after typing http://test.example.com I can see the start page of the installed drupal site ( with formatting and pictures )
I also can access http://test.exampl.com/update.php and other php files

But login fails. ( address line shows "http://test.example.com/node?destination=node" and 500 Internal Error )

I additionally tried to set
RewriteBase /test_site
but there is no change in behaviour. ( pages are visible, but login fails ).

I think I am getting closer.

Thanks for all replies which hinted me toward the solution!

osubbotin’s picture

Hi, again.

I think the problem is rewrite rules which do not work.
I was able to create new user by typing direct link http://test.example.com/?q=user/register

So, it seems that rewrite rules do not work or work incorrectly...

Reading about .htaccess

s.daniel’s picture

Really strange I have installed drupal on alot of different shared envoironments and had different issues (epecially with 1and1 mentioned earlyer where I had server errors in first place as well.) It seems to me like the error is probably not your fault but caused some strange settings of the host.

However something you might want to look at ist drupals multisite features - maybe they help you with your case. If you want to try that copy your sites/default folder to sites/test.example.com and see if you see any changes. You could also try to start with an empty sites/test.example.com folder and see if Drupal asks you to install it at test.example.com then.

Anonymous’s picture

I have a short tutorial on installing drupal in a subfolder.

You can check it out here
http://drupial.com/content/install-drupal-subfolder

You'll probably just want the bottom part. To get it to your test.example.com just replace the www with test. I have successfully done this at http://green.drupial.com. If you need any more help just let me know.

osubbotin’s picture

Hello, everyone.

The core of the problem seems to be on the provider side.

The site came up and became operational after changing the standard rewrite rule to:
RewriteRule ^(.*)$ /index.php?q=$1

( note the "/" before index.php )

Thanks to all of you who was helping me with that!

Oleg.