Welcome to WebmasterWorld Guest from 54.198.164.83

Forum Moderators: Ocean10000 & incrediBILL & phranque

htaccess for first gate

forcing disclaimer initially

     
4:04 pm on Dec 21, 2017 (gmt 0)

New User

joined:Dec 21, 2017
posts: 5
votes: 0


Sorry, newbee, with 5lbs books (Apache 2.4) and 3 days searching loosing all bearings - somebody can give me a hint where to look and what for?
Building a basic (text) .htm webpage I want to force visitors on first contact to agree to a disclaimer (per session).

Idea: index.htm -> disclaimer.htm in subfolder A -> webpage(s) in subfolder B .
Link from disclaimer.htm into subfolder B "if agreed". (No need for any further tracking etc.).
Anybody trying to jump into B not having been in A (i.e. used the link from disclaim.htm before) rejected.

The simplest solution would be the best as just in case only proof would be required to have gone through the disclaimer initially.
htaccess as standalone preferred if that could be achieved, as already writing that private page is a task itself - going into major programming would stall me.
Would somebody have a hint how and where to search for this type of solution?

Thanks.
6:12 pm on Dec 21, 2017 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:11235
votes: 126


welcome to WebmasterWorld [webmasterworld.com], Tilo!

i'm not sure i understand your application precisely but you probably want to research HTTP cookies.
you need to create a session cookie when you serve the disclaimer and then check for that cookie (sent with all subsequent requests in that session) before serving the "private" content.

you might be able to use mod_session:
https://httpd.apache.org/docs/current/mod/mod_session.html [httpd.apache.org]
7:07 pm on Dec 21, 2017 (gmt 0)

New User

joined:Dec 21, 2017
posts: 5
votes: 0


Thanks for the answer.
I would prefer to do that internally - if possible. If not, then cookies (tokens?) seem the only way as I see it now.

Application should be to use the front door once initially in a session. Once inside you may browse whatever you want, as you promised with initial entry to behave. No way to claim you used "the back-door" and did not know about the sign at the front-door.
In principle similar to your page for registering here with the button "accept'.

Basically that sounds like an anonymous log in or authentification (if I got this right) - but I do not want anything to be actively filled in, just a link in the text to an inside page to be clicked (and the other link ["no"] out again to index, very simple).
If I understand session ID each query would get a new one - this does not help either, only, when put the ID to the client, here we go again like with cookies.

But from your answer it looks like I have come to right conclusions, looks like no way with htaccess only, seems I can not avoid picking up php.
I will check the link you provided, maybe it is a better description on the matter than Google or the book.
Thanks.
9:27 pm on Dec 21, 2017 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14608
votes: 598


looks like no way with htaccess only, seems I can not avoid picking up php

In mod_rewrite--which is probably what you mean when you say htaccess--you can both read and write cookies. So if all you need to record is “the user has been to suchandsuch place on their current visit”, that doesn’t require php.

I remember how thrilled I was a few years back when I realized there is no separate “cookie language”. You can read and write them in all sorts of ways.
10:50 pm on Dec 21, 2017 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:11135
votes: 662


I remember how thrilled I was a few years back when I realized...
One of the high points in my life.
7:37 am on Dec 22, 2017 (gmt 0)

New User

joined:Dec 21, 2017
posts: 5
votes: 0


After your hints I came up with the necessity to look closer into session IDs, seems I have not yet understood how they are handled and work.
Basic solution would then be: you visit the "entrance" alias "disclaimer" page above the page-container and get an ID there, which is then put into every link-content in the html(5) page send back. The next query into the container should carry the ID.
I will check out if that can be done with htaccess only, thanks.
8:39 am on Dec 22, 2017 (gmt 0)

New User

joined:Dec 21, 2017
posts: 5
votes: 0


OK, besides abstract description maybe I owe an explanation which is much simpler to understand.
There is an index.htm catching queries which is only a pic with a link pointing to an intro.htm (as it looks like in the next subfolder because of htaccess), and that contains (draft):

intro.htm
Who likes to take notice of the content agrees that:
Freedom of speech is a human right.
Who in spite of his agreement believes that passages with contents are not acceptable or feels being injured is obliged to leave immediately.
Different views, wether linked, quoted or otherwise referred to become on no account the view of anybody else but the original autors.
The page is private in every regard, not commercial. Users who believe to recognise legal offence commit themselves to explain understandably for everyone their concern, free of costs including their opinion about the acceptable handling of the matter.
Mind: Public Power is exactly this: public.
This corresponds to my view and I agree{href="inside-the-page"}.
I am not so shure about that. i-arrow-right.gif {href="google.com"}


The only topic with htaccess is that the page with that agreement can not be avoided initially (I did not see that, I came from another link etc.) The rest will be kept in subfolders in plain html4 (frames? - I know, that is not up to date but I have a convenient program using that) or html5 with no further internal programming, just text/pdf. If you can, keep it as simple as possible is my thought.