Anyone know how to redirect...

mancombseepgood

Executive Member
Joined
Jun 1, 2004
Messages
9,351
Reaction score
2
Location
.
Anyone know how to redirect for (example) http://www.123.com to https://www.123.com? Here's the catch - on the client side only (i.e. not with server side or any JS, etc... kind of like how the hosts file does it - except I can't reirect http to https using hosts...) Cmon all the web boffins out there - is this possible? Thanks!
 
If I understand you correctly, you want to be using a meta tag:

<META HTTP-EQUIV="refresh" content="0;URL=https://www.whateva.com">
 
Depends who is your hosting provider and what OS they are using.

WebAfrica for instance provide ISAPI rewrite (www.isapirewrite.com) to do this server-side on Windows 2003 servers. On a linux server you would use the mod_rewrite function by utilizing the htaccess file.
 
Ok - thanks guys - Freshly-ZN has the idea - I want do do it at the client, not initiate it from a server (server side or client side software) - since I want to be able to redirect someone else's site from my own browser... maybe what I need is a hosts entry pointing to 127.0.0.1 and run IIS with a default redirect on my side? It should work? - Should I be trying your meta Freshly-ZN - it seems to be the way to go?

Before anyone flames me down, I know I am looking at using server stuff with IIS, but what i meant by client vs server is local vs remote... sorry.
 
Last edited:
Well yes Ed

The meta will work but it will work for everyone that loads that HTML page.
If you want to start redirecting based on other criteria like operating system, browser, location etc then you will have to use some sort of serverside method like PHP or some clientside method like javascript. I cant understand why you would want to use IIS to redirect to a hosts file (not sure this is possible? how do you add an entry to the clients host file?)
 
More details

Sorry - maybe I didn't make myself clear - I'm not dealing with a server at all, but my local client. Basically... when I enter www.gmail.com in the browser, I want it to redirect me automatically to https://www.gmail.com

Now... I have done the IIS and redirect thing, which works in part... with the absence of the redirect file, I get a blank screen for www.gmail.com - fine...
when the file is there, I get redirected to gmail using https, but... now this is weird...
it only uses the https for the login screen - thereafter back to normal http for reading mail etc.

Now the way gmail normally works is - if you open http://mail.google.com you get the https sign in screen and the regular http screen, which allows chats and other features.
If you open https://mail.google.com, it gives you the https sign in screen and thereafter you get the https mail screen - with chat features disabled.

What I don't understand is why this redirect doesn't take one to the https gmail (only the sign in is secured)? It seems to be aware that the original request was for the http page for some reason.
 
Top
Sign up to the MyBroadband newsletter
X