?
Solved

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

Posted on 2013-11-30
7
Medium Priority
?
452 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
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

762 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