Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-11-30
7
Medium Priority
?
463 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 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1332 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 668 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 84

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 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1332 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

Industry Leaders: 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!

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . 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…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

609 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