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
Solved

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

Posted on 2013-11-30
7
430 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
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 …

809 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