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 821407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:38:04+00:00 2026-05-15T02:38:04+00:00

I have a site which uses ssl when accessing a subdomain which essentially is

  • 0

I have a site which uses ssl when accessing a subdomain which essentially is hosting the actual app, whereas the front end site is present at www, which I don’t want to use ssl. So this would allow:

http://www.domain.com

but if somebody types:

http://secure.domain.com

they get forced to:

https://secure.domain.com

which when using this subdomain doesn’t allow any non-ssl traffic.

Currently I have this in my .htaccess file:

RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

RewriteCond "%{HTTP_HOST}" !^www.* [NC]
RewriteCond "%{HTTP_HOST}" ^([^\.]+).*$
RewriteRule ^(.*)$ https://secure.domain.com/a/login/%1 [R=301,L]

This works fine, but if I then edit the URI to remove the s from https it still loads the page but without ssl.

If I add:

SSLOptions +StrictRequire
SSLRequireSSL

to the top of the .htaccess file then it always forces the traffic to ssl, but that is for all subdomains including www.

Is there a way to catch only the non-www traffic and force that to use ssl?

EDIT:

To clarify:

For example, if you are at:

https://secure.domain.com/a/login/test 

and the edit the URI to be

http://secure.domain.com/a/login/test 

then it still loads the page but not using ssl. But if I use

SSLRequireSSL 

then it forces the requirement for the entire site, and I don’t want to use ssl at

http://www.domain.com
  • 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-05-15T02:38:04+00:00Added an answer on May 15, 2026 at 2:38 am

    SOLVED

    After a bit of tweaking I have now solved this issue. What I did was edit the .htaccess file that was in the subdirectory where the application is: https://secure.domain.com/a/login/test and set it to detect if ssl was being used or not (I should add the rest of the .htaccess file is for the benefit of CodeIgniter):

    RewriteEngine on
    
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    
    RewriteCond %{HTTPS} on
    RewriteCond $1 !^(index\.php|images|includes|css|js|robots\.txt|favicon\.ico)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web site which uses one SQL database but the hosting company
I have a site which uses largeish (60-100k) background images which vary from page
I have a site which uses a lot of JavaScript (mainly jQuery) and I
I currently have a site which uses a MySQL 4.x schema, the site uses
I have an ASP.NET site which uses a 3rd party activeX control. I have
I am relatively new to mod_rewrite, but have a site which I would like
I'm pulling my hair out on this one. I have a site which is
I have a c# site which makes use of a lot of images with
I have a web site which I download 2-3 MB of raw data from
I have inherited a client site which crashes every 3 or 4 days. It

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.