https website got forward to another instance

I have a development webserver with ten virtual hosts and drupal system.

when I put https:// before each namespace, all of them got forwarded to one specific instance instead of its own http:// version. Here is my httpd.conf setup file.
Jason YuAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The httpd.conf file you posted has nothing in it dealing with SSL, so you need to check the conf, files  in the directory /etc/httpd/conf.d  directory.
Jason YuAuthor Commented:
After I updated this file and add a new virtual host section, the drupal backend for the original section doesn't work now, it gave "access dened" error.
Back out the changes you made then.  Drupal create .htaccess files and does some rewrites.

So in addition to looking at/for configuration files in /etc/httpd/conf.d , you need to look at the .htaccess files in the documentroot for each of your virtual hosts.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Jason YuAuthor Commented:
I am not sure which line is controlling the backend drupal login. Could you please take a look at the .htaccess file?

Jason YuAuthor Commented:
is this line the one?

# Set "protossl" to "s" if we were accessed via https://.  This is used later
  # if you enable "www." stripping or enforcement, in order to ensure that
  # you don't bounce between http and https.
  RewriteRule ^ - [E=protossl]
  RewriteCond %{HTTPS} on
  RewriteRule ^ - [E=protossl:s]

so I need add:

RewriteRule protoss="s"
No, that rewrite code sets an environmental variable "protossl" to "s" if the request was https.  

What you want to look for is a virtual host definition that is set to listen on port 443 and what rewrite rules it may have associated with it.

Now one rewrite rule I did find is:

  RewriteCond %{HTTP_HOST} ^$ [NC]
  RewriteRule ^(.*)$$1 [R=301,L]

What this does is if the host name does not start withe you will be redirected to

So of somebody enters something like, since the host name does not start with, they would be re-directed to    This assumes that the .htaccess file you posted is under the directory /var/www/lac2014/html.
Jason YuAuthor Commented:
Thank you, giltjr, I appreciate your time to explain this to me.

Firstly, I have to let you know I am very new to Drupal system. Only get to know it since I joined this company.

Secondly, I got more confused about the and Based on my former knowledge and experience. The https link should be forwarded to http link after user's logon, is this concept correct.  The reason I am asking this question is, when I put different prefix (http:// and https://) before my namespace, (like, it hows total different websites. I am attaching a print screen for your verification.

Since these are internal webservers, you may not open the links from internet.

Please correct me if I am wrong.

Jason YuAuthor Commented:
I have 8 virtual hosts on this development webserver. It uses apache and drupal combinations.

The first 4 instances are the original instances. The second 4 instances were clones of the first 4. Right now, the issue is for instance 2 to instance 8, if I input the links with https://, all 7 instances will link to the database for the first instance.
You MUST find the configuration file that has the virtual host definitions that are listening on port 443.
Technically when doing virtual hosting the http and https sites are two unique sites.  What makes them the same is if both VirtualHosts definitions are setup exactly the same, except of course the listening port (443) and all the definitions required for SSL.

--> "Based on my former knowledge and experience. The https link should be forwarded to http link after user's logon, is this concept correct. "

No, by default if you go to https you are always https.  Now some website MAY be configured/scripted in a way that the login is done using https and then switched to http, but that is not the norm.

And this has nothing really to do with Druple.  It has to do with how Web servers work period.
Jason YuAuthor Commented:
Here are the replies from my developer, do you think this is a SSL certificate issue. If so, I have to suggest to buy certificates for each https site.

"The issue actually seems to be that whenever you use https it always redirects to the main lac2014 directory, regardless of which domain it is

For example I placed info.php in each directory

echo $_SERVER['HTTP_HOST'] . " - Document root = " . $_SERVER["DOCUMENT_ROOT"];
?> shows document root as  /var/www/staging/lac2014/html

BUT shows document root as /var/www/lac2014/html shows document root as /var/www/lac2014/html shows document root as /var/www/lac2014/html shows document root as /var/www/lac2014/html shows document root as /var/www/lac2014/html


I think this is an SSL issue, since there’s no certificate on the other domains, it redirects to the domain with the SSL cert."
I am going to say this one more time.

Someplace in all of your http configuration files there is a virtual host definition that is setup to listen on port 443.  You MUST, read this MUST, find that definition.

Your output above implies that you have a SINGLE virtualhost listening on port 443 and not 8 virtual hosts.  It has NOTHING to do with the SSL certificate itself.  It has EVERYTHING to do with the VirtualHost definition for the virtualhost listing on port 443.
Jason YuAuthor Commented:
Got it, finally, I found this file under /etc/httpd/conf.d/ssl.conf.

from line 76 to the end of the file, it defined that SINGLE  virtualhost listening on port 443. My question is if I add more Virtualhost sections for port 443 in this file, do I need repeat everyline in this section?

Well, I can't give you a blanket no.  

What I can say is that you need a VirtualHost definition that listens on port 443 for eachVirtualHost  you have listening on port 80.

Do you have a unique SSL Certificate for each virtual host name you have?  If so, you will need to make sure that each virtual host section points to the correct certificate.  If you don't, then all the sites except for the one the certificate is for will get an error.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jason YuAuthor Commented:
Got it, a very satisfied answer. I will go buy certificate first then clone the sections for ssl port.
Jason YuAuthor Commented:
Very detail answer, thank you for your help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.