Solved

Redirect few (2) pages of website in https and other (3) pages in http mode.

Posted on 2013-11-30
7
434 Views
Last Modified: 2013-12-10
Hello,

I have a site consisting of  5 pages out of which there are 2 pages through which the site data gets registered in the database rest are simple pages.
what i need is to convert the  url of theses 2 pages to "https" as per the requirement rest theree pages should be in "http".

I have googled and came across the solution like below

window.location = window.location.href.replace(/^http:/, 'https:');


Is it the correct way to convert the pages to https?
Will the data be in encrypted form as it default functionality of https?
Will there be any certificate needs to be created for testing purpose?
0
Comment
Question by:Rocking
[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
  • 3
  • 3
7 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 333 total points
ID: 39687213
To use HTTPS on the public internet, you must purchase and install an SSL/TLS certificate.  When you do that, any request starting with 'https://...' will negotiate a secure connection before it transfers any data.

You can also 'redirect' to the HTTPS connection in your programming language like PHP or in your .htaccess file on the server.
0
 

Author Comment

by:Rocking
ID: 39687232
It means this code will not work in https true sense

window.location = window.location.href.replace(/^http:/, 'https:');

I just need to test the web application.

http://xxx.xx.xx.xx/a.html
http://xxx.xx.xx.xx/b.html

now from b.html it goes to c.jsp which should open in
https://xxx.xx.xx.xx/c.jsp


What configuration i need to make so that i can test in my environment which is in tomcat
and jsp? It would be a great help if you can provide me some steps or url?
0
 
LVL 9

Accepted Solution

by:
QuinnDex earned 167 total points
ID: 39687240
to test or use on a private network you can create your own certificate see link below

http://www.akadia.com/services/ssh_test_certificate.html

as already mentioned you will need to buy a certificate to publish your site to the web, but these can be got for as little as £5 a year

best way to redirect to https is with a 301 redirect, do not use javascript as users with it turned off will not be redirected

use the rewrite mod below

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^YOURPAGE https://secure.example.com/YOURPAGE/ [R=301,L]

Open in new window

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Rocking
ID: 39687253
How to make configuration in tomcat for the below scenario

http://xxx.xx.xx.xx:8080/a.html
http://xxx.xx.xx.xx:8080/b.html

from b.html it goes to

https://xxx.xx.xx.xx:8080/c.jsp

and from this jsp after inserting data in db moves back to
http://xxx.xx.xx.xx:8080/a.html

flow is http -> https -> http

I am using jsp,java and apache tomcat.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39687266
You are correct,  'https' will not work without a certificate.  None of the rest matters since it is the certificate and the web server that enable the HTTPS mode.
0
 

Author Comment

by:Rocking
ID: 39687274
Thanks for the replies. Through the above help,I googled but everyone is talking about Apache Server.


All i need is to do some server configuration and create a self certificate for testing the scenario mentioned in my previous post.

I didn't came across any tomcat configuration for the above task.Since i am using standalone tomcat server,what configuration i need to make in it?
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 333 total points
ID: 39687399
Here's the man pages for Tomcat SSL: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime is disastrous for companies and can lead to major hits on a brand, reputation, an…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

726 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