Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

https/http redirect

Status
Not open for further replies.

noslenwerd

Programmer
May 2, 2005
59
US
Ok, i need a little statement that i can put in out redirect.jsp page that will automatically put CERTAIN users to https: if they try typing in http. The reason it is only for certain users is because some people do not have SSL sites.

Also the reason we don't just make different files is because all of our ASP customers use the same redirect.jsp page

Could I use something similar to this? I know it needs tweaked but not quiet sure how to...

if(location.href.indexOf('firstsite.com')>-1)
{
location.href='redirect.asp?page='+escape(location.href.replace(/firstsite\.com/gi,'secondsite.com'));
}
 
>>Ok, i need a little statement that i can put in out redirect.jsp page that will automatically put CERTAIN users to https: if they try typing in http. The reason it is only for certain users is because some people do not have SSL sites.

confused, users have SSL sites???

Known is handfull, Unknown is worldfull
 
maybe im confused on how to word it but...

bottom line is i need a way for my redirect.jsp page to check out the domain name someone is entering from, and based on that domain name, send them to either https:, or http:.

So basically i will have 2 lists in my if statement, the list of people who need to be redirected to https:, and those that do not.
 
u have to use the same indexOf() method that u have used in ur code above:
if(location.href.indexOf('

Known is handfull, Unknown is worldfull
 
hmm... still a bit confused, im a bit new to javascript so excuse my ignornace... but how do i handle listing each site?
is this how you are saying i need to have the code written?


if(location.href.indexOf(' {
location.href='redirect.asp?page='+escape(location.href.replace( }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top