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

  • SEARCH
  • Home
  • 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 7191723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:47:24+00:00 2026-05-28T19:47:24+00:00

This should be a quick one… here is my current .htaccess file: # BEGIN

  • 0

This should be a quick one… here is my current .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

What I need to do is make sure that if http://www.mydomain.com/cart/ is reached, it needs to force HTTPS … so /cart/ and anything within /cart/

  • 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-28T19:47:25+00:00Added an answer on May 28, 2026 at 7:47 pm

    Once the request has been sent to http://www.mydomain.com/cart/, if there is any sensitive data in the request, it’s too late. Force it to break! At least, it will give you an indication that there’s something wrong with your links. More details in previous answers:

    • https://stackoverflow.com/a/8765067/372643
    • https://stackoverflow.com/a/8964190/372643

    [ … ] by the time the request reaches the server,
    it’s too late. If there is a MITM, he has done his attack (or part of
    it) before you got the request.

    The best you can do by then is to reply without any useful content. In
    this case, a redirection (using 301 or 302 and the Location header)
    could be appropriate. However, it may hide problems if the user (or
    even you as a developer) ignores the warnings (in this case, the
    browser will follow the redirection and retry the request almost
    transparently).

    Therefore, I would simply suggest returning a 404 status:

    • http://yoursite/ and https://yoursite/ are effectively two distinct sites. There is no reason to expect a 1:1 mapping of all
      resources from the URI spaces from one to the other (just in the same
      way as you could have a completely different hierarchy for
      ftp://yoursite/).
    • More importantly, this is a problem that should be treated upstream: the link that led your user to this resource using http://
      should be considered as broken. Don’t make it work automatically.
      Having a 404 status for a resource that shouldn’t be there is fine. In
      addition, returning an error message when there is an error is good:
      it will force you (or at least remind you) as a developer that you
      need to fix the page/form/link that led to this problem.

    EDIT: (Example)

    Let’s say you have http://example.com/, the non-secure section of your site that allows the user to browse items. They’re not logged in at that stage, so it’s fine to do it over plain HTTP.

    Now, it’s cart/payment time. You want HTTPS. You send the user to https://example.com/cart/. If one of the links that sends the user to the cart part is using plain HTTP (i.e. http://example.com/cart/), it’s a development mistake. It just shouldn’t be there. Making the process break when you thought you were going to be sent to https://example.com/cart/ allows the developer to see it (and, once fixed, the user should never have the problem).

    If it’s just about the point to the HTTPS section of your site (typically, an HTTP GET via a link somewhere), it’s not necessarily that big a risk.

    Where automatic redirects become even more dangerous is when they hide bigger problems.

    For example, you’re on https://example.com/cart/creditcarddetails and you’ve filled in some information that should really just stay over SSL. However, the developer has made a mistake and a plain http:// link is used in the form. In addition, the developer (a user/human after all) has clicked on “don’t show me this message again” in Firefox when it says “Warning: you’re going from a secure page to a non-secure page” (by the way, unfortunately, Firefox warns a posteriori: it has already made the insecure request by the time it shows the user that message). Now, that GET/POST request with sensitive data is sent first to that incorrect plain http:// link and the automatic rewrites tells the browser to try the request again over https://. It looks fine because, as far as the user is concerned, this all happened in a fraction of a second. However, it’s not: sensitive data was sent in clear.

    Making the plain HTTP section of what should only be over HTTPS not do anything useful actually helps you see what’s wrong more clearly. Since the users should never end up there anyway if the links are correctly implemented, this isn’t really an issue for them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should hopefully be a quick one. I have a StringBuilder like so: StringBuilder
This should be a quick one. Is it possible to do something like this:
This should be simple enough. Here's my one line of code that's giving me
hopefully this should be a quick and simple one, using PHP I'm trying to
Hopefully this should be a quick one to solve but - I'm building a
This should a quick question for some easy rep. I'm doing some PHP Website
Two quick questions if I may, is this how I should go about taking
This should hopefully be a simple one. I would like to add an extension
This is one of this things that should be extremely simple and I just
It is said here http://code.google.com/intl/ru-RU/webtoolkit/tools/gwtdesigner/quick_start.html that one should Choose an appropriate panel type for

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.