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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:53:01+00:00 2026-05-11T08:53:01+00:00

When I´m in a secure part of a web-site I´m developing (entering a specific

  • 0

When I´m in a secure part of a web-site I´m developing (entering a specific page or folder using https), the relative links to the normal pages are automatically converted to https as well.

Is there a way to tell an <a> tag to always use the http protocol instead of the https protocol (or the other way around)?

I know it´s easy using the complete link (http://www.mysite.com/index.html or https://www.mysite.com/index.html), but I would like it to work with relative links (index.html, ../index.html, etc.).

  • 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. 2026-05-11T08:53:02+00:00Added an answer on May 11, 2026 at 8:53 am

    We use Apache mod_rewrite to control whether a page is served via http or https. Here’s an example snippet from a site’s root directory .htaccess file:

    # Redirect most reqests for https to http RewriteRule ^https://www.example.com(.*) http://www.example.com$1 [R=301,NC]  # Allow some URIs to be https if requested RewriteCond   %{SERVER_PORT}  ^443$ RewriteCond   %{REQUEST_URI}  !^/images/(.*)$ RewriteCond   %{REQUEST_URI}  !^/scripts/(.*)$ RewriteCond   %{REQUEST_URI}  !^/styles/(.*)$ RewriteCond   %{REQUEST_URI}  !^/store(.*)$ RewriteCond   %{REQUEST_URI}  !^/login.htm$ RewriteRule ^(.*) http://www.example.com/$1 [L,R]  # Force some URIs to be https only RewriteCond   %{SERVER_PORT}  ^80$ RewriteRule ^store(.*) https://www.example.com/store$1 [L,R]  RewriteCond   %{SERVER_PORT}  ^80$ RewriteRule ^FormSanityKey.htm https://www.example.com/login$1 [L,R] 

    Read all about it at:

    http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

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

Sidebar

Related Questions

I'm developing a web site in a high-security environment. For example, we use CAC
What is common practice for coding web applications where part of the site has
I'm developing a website and I'm trying to secure the connection part. I used
I'm developing a SharePoint 2010 Web Part (in C#) which needs to pull user
I am creating some web services which I would like to secure using a
I'm trying to secure a WCF service using windows accounts. The service should run
Is it sufficient to secure a Java web application with the rights of the
How do you secure a UniData session using UniObjects for .net? The documentation is
I need to secure my website without using the ASP.NET built in login controls
I am trying to secure communications via SSL/TLS for one of our Web Service

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.