Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8020411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:41:11+00:00 2026-06-04T21:41:11+00:00

I have virtual hosts <VirtualHost 10.10.10.10:80> ServerAdmin webmaster@server.com ServerName server.com ServerAlias subdomain-a.server.com subdomain-b.server.com subdomain-c.server.com

  • 0

I have virtual hosts

<VirtualHost 10.10.10.10:80>
     ServerAdmin webmaster@server.com
     ServerName server.com
     ServerAlias subdomain-a.server.com subdomain-b.server.com subdomain-c.server.com subdomain-d.server.com
     DocumentRoot /srv/www/server.com/public_html/
</VirtualHost>

<VirtualHost 10.10.10.10:443>
     ServerAdmin webmaster@server.com
     ServerName server.com
     ServerAlias subdomain-a.server.com subdomain-b.server.com subdomain-c.server.com subdomain-d.server.com
     DocumentRoot /srv/www/server.com/public_html/
</VirtualHost>

I want to force visitors use https for subdomain-a and subdomain-c. Visitors of subdomain-b and subdomain-d could use http and https. How to configure .htaccess?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:41:12+00:00Added an answer on June 4, 2026 at 9:41 pm

    Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

    Options +FollowSymLinks -MultiViews
    # Turn mod_rewrite on
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{HTTP_HOST} ^(subdomain-a|subdomain-c)\.server\.com$ [NC]
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<VirtualHost *:80> ServerAdmin webmaster@dev.dom.com DocumentRoot C:/Program Files/Apache Software Foundation/Apache2.2/htdocs ServerName dev.dom.com ServerAlias dev.dom.com ErrorLog
I have a file like this <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/ <Directory />
I have the following virtual host configuration <VirtualHost petyo.net:443> ServerAdmin m@petyo.net DocumentRoot /home/ren/public/ <Directory
Here's what I have: <VirtualHost 127.0.0.1> DocumentRoot D:\XAMPP\xampp\htdocs\mysites\tupega.com ServerName tupega.tld <IfModule mod_rewrite.c> RewriteEngine on
Hi I have a server which has several virtual hosts set up on it.
I have modified my etc/hosts file (under Windows 7), so that www.example.com and demo.example.com
My document root is /var/www and I have no virtual hosts enabled. This is
I have been trying to configure my apache server to support virtual hosts, these
I have two virtual hosts in httpd.conf one for port 443 and one for
I have two virtual hosts on windows(for example: test1.dev and test2.dev). But it always

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.