Default to home page

C

Centaur

Hi all

In making web pages other than the home page index.htm is there any way of
putting code in all the other pages so that if someone enters the site other
than by the home page, it automatically opens the home page, so that
navigation can start from there.

Thank you, to all who reply in anticipation.

Centaur
 
M

Matthias Gutfeldt

Centaur said:
In making web pages other than the home page index.htm is there any way of
putting code in all the other pages so that if someone enters the site other
than by the home page, it automatically opens the home page, so that
navigation can start from there.

Check the referrer, and if it's not your homepage, send them to the
homepage. This can be done with a setting in the server configuration.

But I think it's a very bad idea. What problem are you trying to solve?


Matthias
 
D

Dennis M. Marks

Centaur <[email protected]> said:
Hi all

In making web pages other than the home page index.htm is there any way of
putting code in all the other pages so that if someone enters the site other
than by the home page, it automatically opens the home page, so that
navigation can start from there.

Thank you, to all who reply in anticipation.

Centaur
Check document.referrer for the home page.
If not equal then set document.location.href to the home page.
 
K

Karl Groves

Centaur said:
Hi all

In making web pages other than the home page index.htm is there any way of
putting code in all the other pages so that if someone enters the site other
than by the home page, it automatically opens the home page, so that
navigation can start from there.

Why would you want to do that?
In doing so, you're inconveniencing users who've bookmarked a particular
page that interested them or who were referred to the page by a friend.

-Karl
 
A

Andrew Urquhart

*Dennis M. Marks* said:
Check document.referrer for the home page.
If not equal then set document.location.href to the home page.

Anything involving the optional HTTP referrer like this is going to work
really badly for those folks with certain browsers, 3rd party software
and firewalls that are set to not send/block referrers.

The OPs question is commonly seen in relation to frame-based navigation
and the issue of users arriving at pages without the navigation frame
attached. If this is the reason for the redirect then there are
alternative methods of globally including repetitive blocks. For example
via server-side includes (SSI).
 
C

Centaur

HI Mattias

My web site uses frames, however, I notice from the web log, somtimes people
are entering on pages such as the "Answers" page to FAQ, or even some
products page. Now people arn't likelt to buy anything if they don't know
who they are buying form - some people of coarse can look atthe url and
reduce it to its lowest level ie www.mysite.com, but i was hoping I can save
people the problem, so long as it does'nt cause me other navigational
problems. I didnt really want to plague each page withe a "If you arrived on
this page then click here to star" or similar

May I ask why iys a bad idea please,

Best wishes and thank you for replying

Centaur
 
E

Eric Bohlman

Why would you want to do that?
In doing so, you're inconveniencing users who've bookmarked a
particular page that interested them or who were referred to the page
by a friend.

Not just them. You're also virtually guaranteeing that anyone who finds
you through a search engine will land on your home page, which won't
contain what they were searching for. And that virtually guarantees that
the user will go back to the search engine and try somebody else rather
than trying to search for it on your site. And if they do stick around,
their trust in you has probably been lowered; after all, sleazy operations
are well-known for trying to make their sites come up on searches for
unrelated things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top