anyone know how to make your site accessible from only the frontpage

meaning if someone types a URL of my site into the browswer they are sent to the frontpage and can only enter and navigate the site from there?

Comments

attiks’s picture

make your site private and force everybody to register is the best you can do you, this will force them to login and they will be redirected to the frontpage, but once logged in they can type in whatever they want.

Keep in mind that no search bot will index your site!

PS: What do you want to accomplish by this scenario? Avoid people bookmarking your site?

Attiks - graphic design and web applications

fronbow’s picture

don't tell anyone the page urls of your site, then use hidden frames.

When someone visits your site, the front-page has the necessary javascript that sets the hidden frames if they haven't already been set.
You could probably put this very same js code in each page.tpl.php but you will lose visitors as they will try to navigate or bookmark your site only to be redirected to the home page when the hidden-frame-checker finds they're not in frames and boots them back to the front page.

But, why would you want to do this?
If your site is so private that you don't want people to see the urls, maybe it shouldn't be on the web?

netentropy’s picture

its quite the opposite really,

there are parts of my site although suitable for most people, i wouldn't want a 10 year old to find on a search.

i am just trying to keep that from happening ,

i have seen many sites do it, where if you try to access the page directly you are taken to the "homepage"

attiks’s picture

it's possible unless the kids are whiz kids, but you'll needing custom development:

set a cookie on the frontpage
on each page see if the cookie is valid (i.e. passed through frontpage in the last x hours)
if not redirect the user to the frontpage

PS: you can do the same using sessions
PSS: build in some mechanism to allow search bots to access you're site (check agent string or IP addresses)

Attiks - graphic design and web applications

netentropy’s picture

yeah that is exactly what i am trying to figure out.

i really can't believe there isn't a module for this

there is a site access module but it is based on email and passwords

i would have no idea how to set up the cookies on every page

netentropy’s picture

yes that is me , i posted after i found out exaclty what i was looking for

so how could one add the custom cookie code to each drupal page?

attiks’s picture

on top of my head, some options

- build a module that intercepts some node hook, don't know which one but check the API
- change template.php to add a cookie handler
- change page.tpl.php to add the php code

i think the last one is the easiest if you don't know the API, but probably the less cleanest

Attiks - graphic design and web applications

netentropy’s picture

thanks

hopefully some gracious person will help me out here...

i am not very familiar with the api but i am getting better

will the page.tpl.php affect all of nodes?

attiks’s picture

page.tpl.php affects all nodes unless you define extra templates, like page-front.tpl.php for example

good luck, and if you find a solution can you post it?

Attiks - graphic design and web applications

netentropy’s picture

oh i definitely will....

i believe i will set a cookie by form on the front page and then add the cookie check to the top of others....

ill let you know how it goes. wish me luck

Unity’s picture

I happened upon both of these pages in a row, looking for something else, so I thought I'd link them together. This module seems to answer the question:

http://drupal.org/project/roadblock