Solved

Redirecting Single Page from HTTP to HTTPS

Posted on 2014-02-05
8
278 Views
Last Modified: 2014-02-05
I am trying to redirect HTTP requests for a single page on our web site to HTTPS. The page in question, which I'll call "example.html", is in the root folder of our site. I am not too familiar with this process, but from browsing the Internet, I came up with the following which I added to the ".htaccess" file in the root of our site:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^example\.html$ https://www.oursite.com/example.html [R=301,L]

Open in new window


Once I do this, attempts to reach this file, either via HTTP or HTTPS, result in the following error being displayed:

The requested page "/example.html" could not be found.

Can you point me in the right direction here?

Thanks,

bhaf
0
Comment
Question by:bhaf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39837021
Are you sure the file exists and is named exactly the same (including case and extension)
The code as is above is fine.
0
 

Author Comment

by:bhaf
ID: 39837051
I double checked the file name including case and extension, and all looks good. However, the name does have a dash in it (like "example-file.html"). Does the dash need to be escaped in the RewriteRule?

I'll also check out the tutorial Chris posted.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39837061
Dash makes no difference.
Can you provide a link?
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:bhaf
ID: 39837345
Here is a link to the page in question on our site. Note that I set the .htaccess file back to the default to prevent problems for our clients, so you won't actually see the error.

http://www.celticcapital.com/celtic-login.html
0
 
LVL 58

Expert Comment

by:Gary
ID: 39837355
Can you add in the redirect again, so I can quickly check.
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39837423
I see you added the redirect and it seems to be working fine my end.
0
 

Author Comment

by:bhaf
ID: 39837441
Yeah, it is working okay here too. I wonder if it was some kind of caching issue on my end as my first attempt had an error in it. I closed browsers, deleted temp file, flushed DNS, etc. and it is working okay now.

In any case, thanks for helping me!

Bhaf
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question