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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:37:48+00:00 2026-06-11T12:37:48+00:00

I’m trying to do something really simple here but it’s kicking my butt haha.

  • 0

I’m trying to do something really simple here but it’s kicking my butt haha. I have my website, and I got a SSL certificate for it this morning. I want my users to be redirected to the secure site, but I only need the certificate for a certain portion of my website so I don’t want to worry about everywhere else. The certificate is made to domain.com not www.domain.com. The part of my website where I need the certificate, all of the pages are in the apps directory. For example domain.com/apps/login.php. Here is what I have been putting in my .htaccess file.

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/apps/.*$
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://domain\.com%{REQUEST_URI} [R=301,L]

Now I will explain what I think this should be doing and I would like to be told where I’m wrong haha.

  • RewriteEngin On – Allows redirects
  • RewriteCond %{REQUEST_URI} ^/apps/.*$ – Checks if user is in the apps directory
  • RewriteCond %{HTTPS} !=on – Checks if user is already using https://
  • RewriteRule ^(.*)$ https://domain\.com%{REQUEST_URI} [R=301,L] – Redirect

This partially works. When I type in www.domain.com/apps/login.php it redirects to https://domain.com/apps/login.php. Perfect. But if I just type in www.domain.com it redirects to https://domain.com. So it seems that my line RewriteCond %{REQUEST_URI} ^/apps/.*$ is broken. What do I need to put there to make it so that it only redirects to the secure site when they are in the apps directory?

  • 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-11T12:37:49+00:00Added an answer on June 11, 2026 at 12:37 pm

    Your rule looks to me like it should work, but in any case you don’t need the RewriteCond %{REQUEST_URI} test. Just include ^apps in the RewriteRule:

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^apps/(.*)$ https://domain.com/apps/$1 [R=301,L,NC]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Seemingly simple, but I cannot find anything relevant on the web. What is the
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is

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.