Forum Discussion
Ellen_26856
Feb 21, 2011Nimbostratus
How to make client enter website from the first page?
Hi, Can anybody tell me How to make client enter website from the first page?
I mean if the the first page of url is: http://www.ourcompany.com/index.htm, anyone who connect our company's website doesn't from this url (ex. http://www.ourcompany.com/subfolder/page2.htm) will be redirect to http://www.ourcompany.com/index.htm.
Ellen
- hooleylistCirrostratusHi Ellen,
when HTTP_REQUEST { Session cookie name used to track whether client has requested a root URI set name "my_session_cookie_name" URI to redirect clients to who haven't accessed a root URI before the current request set redirect_uri "http://www.example.com/index.htm" Track whether we need to insert a session cookie in the response set insert_cookie 0 Check if request is to root document switch [HTTP::uri] { "/" - "/index.htm" { Insert a cookie in the response, if client doesn't have one already if { [HTTP::cookie $name] eq "" }{ Track that we need to set a session cookie in the response set insert_cookie 1 } } default { Non-root page, so check for cookie if { [HTTP::cookie $name] eq "" }{ HTTP::redirect $redirect_uri } } } } when HTTP_RESPONSE { Insert a session cookie if the client accessed a root URI and didn't have a cookie already if { $insert_cookie }{ HTTP::cookie insert name $name value "1" path "/" } }
- Ellen_26856NimbostratusDear Aaron:
- Ellen_26856NimbostratusDear Aaron:
- hooleylistCirrostratusI can't think of another way to implement this. I don't think the iRule is a good solution either though. It shouldn't add much load, but it will definitely affect accessibility of your site (no cookie support = no access).
- Ellen_26856NimbostratusFor some special days, there are too many clients access our website. For these special days, we will design a simple home page(which contains just some link) to reduce network traffic and server loading. But some clients have bookmark some pages, then direct to these pages. So we need to let these clients that have bookmark some pages to enter website from the home page(first page).
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects