HowTo: http:// address redirect to http://www address -I see many sites where http:// won't load

How to do that?
http:// address redirect to http://www address
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

for example- if you want to be redirected to add the following code:

 if(top.location == ""){
   top.location = "";
gizmoadriaAuthor Commented:
does the script go in the header?

what happens if my pages are php based?
gizmoadriaAuthor Commented:
Any other ways?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

basicly that is problem for the browser which are not well programed but this method should work well and it is typed in the <head> ...
but I sugest that you simply add more info in the header for the page ... I mean description !
That should ease some browsers some not but if you desire the best way of redirecting it is simply to go trough the HTTP protocol because I think that isn't work of the designer of a web page .

And about PHP , there is no problem just stay cool !

Regards !
If you are trying to redirect users from one site straight to another try using this as the index.html file of site 1

<meta http-equiv="refresh" content="0; url=">

Is that what you mean?
gizmoadriaAuthor Commented:

I have noticed more and more, some sites come up if you type in just:

others will give errors so  you have to type in

I want attempts to load "" from the browser actually load up, rather than "Page Not Found"

That's because techincally and are two different websites..

Depending on how the webserver is setup, will determine what is sent back to the client..

You mentioned PHP above.. Im assuming that you are using Apache on a *nix box?  You need to make sure that your httpd.conf is setup to handle both and .. Multiple ways of accomplishing this..
i would use location.replace

if(location.href == ""){
If you own both and you can just set your webserver to redirect from to That way you don't need to have anything in the actual pages and the web server catches it so there is very little processing. Also a <meta http-equiv="refresh" content="0; url="> line in your code means that the user has to first download this file then download a second file - over a 56K modem it can be a bit anoying as it just takes a little extra time.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gizmoadriaAuthor Commented:

technically, they are 2 different sites?

Mailboy2, my point exactly, I don't want to have user download page first to then be redirected.
I don't really know how the http run these things but what I'm sure about is that it is in the protocol ... I mean that www is just some description like news or mil (military) and such other descriptions for type of sites ... but what the problem is ?!? It is in the http protocol !

you have

try making some logical understand to this !

I read a book (100 pages) about http and the experience that the book actualy gave me was basicly but at least I have an understanding with the protocol and what in the book is all writen about is just that http is not so coded(maybe not a good word) in a page than in server or app .
Try the script the people gave you in top if not try to configure you apache or what ever server you are administrating if you aren't the admin of the server and the server is commercial waybe the admins of it can tell you more about your problem but as I said try to read about http protocol to understand what it is all about and how it works ...

Regards !
>>does the script go in the header?

>>what happens if my pages are php based?

It can go to anywhere in the page in theory. but in the header would probably be the best...

It does not matter if the pages are php based
Even though this is old, I'd just like to add (for reference) that the difference in the 2 sites is the DNS. = 1 DNS record = another DNS record,,,

Each of those are a different DNS record, each residing on a zone file for Within each record, you can set the address of the site to an IP or to another address on that zone ( I believe it has to be that same zone anyways...)

So if you can't get to a site by typing in www., that means the webmaster and/or the DNS admin is lazy...

<|ken|Wed Jan 28 10:35:26|>nslookup

Non-authoritative answer:

<|ken|Wed Jan 28 10:35:30|>nslookup

Non-authoritative answer:
*** Can't find No answer


<|ken|Wed Jan 28 10:37:37|>nslookup

Non-authoritative answer:        canonical name =

<|ken|Wed Jan 28 10:37:47|>nslookup

Non-authoritative answer:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.