Sponsored Content
Top Forums Web Development How to detect browser and re-direct Post 302246020 by cbkihong on Sunday 12th of October 2008 09:55:47 AM
Old 10-12-2008
You can examine the HTTP "User-Agent" header that may carry information about the user's browser used. How to do depends on your server-side development platform (e.g. CGI/PHP/Java etc.) However, because that field can be easily forged, it is not necessarily accurate but that is mostly what you can do.

For redirects, there are mainly 2 ways: HTTP redirect and HTML-based (browser) redirect. With HTTP redirect the server-side generates a redirect (a "moved" HTTP response) that the browser responds to. The second way is to generate a meta tag in the HTML returned to browser, that the browser will do the redirect, but only after the original response is rendered completely. Again, how to do depends on your development platform.

The main difference is that HTML-based redirect will break the "back" button. If the user presses the back button after the redirect, the browser will run the redirect again and the end result is the user is not redirected.

You do not necessarily need to do this with programming. I think you can also implement some of these redirect schemes with certain Apache configuration directives. Dealing with this the Apache way is not my favourite, but that is up to you.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem using connect direct

Hi, I have a script in which i'm using ndm connect direct to fetch data from the client server..syntax i'm using is ./con_using_connectdirect /load/nctrl nctrl $xhost where con_using_connectdirect is the script which establishes connection load/nctrl is the path from where data... (4 Replies)
Discussion started by: Sheema
4 Replies

2. Solaris

Direct login without password

Hi, I am trying to setup direct login from server test1 (Solaris 10) to server test2 (Solaris 9) using id taops (ldap id). Process Followed on Test 2. created .rhosts file in home directory of user taops geneted public key on test1 and appended to authorized keys on test2. Now trying... (8 Replies)
Discussion started by: tuxian
8 Replies

3. UNIX for Dummies Questions & Answers

re-direct to log file

#!/bin/ksh -x cd /tmp/tj ftp -n servername.com << DONE user username password as put test.log quit close DONE echo "testing..." sh -x scriptname, and it shows all, but username, as, put, quit, close, DONE. how can i see those ? (1 Reply)
Discussion started by: tjmannonline
1 Replies

4. Shell Programming and Scripting

Connect:Direct

Hello all, I have a requirement to transfer files to mainframe usinf NDM connect:direct. So can anybody provide me a sample shell script on how to call a connect;direct script by providing filename as a parameter please? Thanks, Ajay (0 Replies)
Discussion started by: ajaykumar4534
0 Replies

5. Shell Programming and Scripting

Manipulating sed Direct Input to Direct Output

Hi guys, been scratching round the forums and my mountain of resources. Maybe I havn't read deep enough My question is not how sed edits a stream and outputs it to a file, rather something like this below: I have a .txt with some text in it :rolleyes: abc:123:xyz 123:abc:987... (7 Replies)
Discussion started by: the0nion
7 Replies

6. UNIX for Dummies Questions & Answers

Can I re-direct nohup to a different filename?

Hi, I want to be able to run a script nohup & but I want the output file named like <script>.out instead of nohup.out. Is there anyway to achieve this? At the moment, workaround is I cd to a different directory and then do nohup <script> &. So far, I've tried below but it does not seem to... (2 Replies)
Discussion started by: newbie_01
2 Replies

7. Shell Programming and Scripting

Direct read / load

Guys, I wrote a script to do the following - Read a file that is placed into a directory and depending upon the contents, load into one or multiple tables into Oracle. After the file is loaded into the table, depending upon the exit status of the process I will either delete the file or... (3 Replies)
Discussion started by: ManoharMa
3 Replies

8. Shell Programming and Scripting

File not exist in direct

friends can do this from unix AIX I need to ask for a file that does not exist then if file.txt * **** echo "execute procedure" else *** echo "File does not exist" if You can sucedere that the file does not exist (2 Replies)
Discussion started by: tricampeon81
2 Replies

9. UNIX for Beginners Questions & Answers

Direct Printing In AIX

Hello. I recently upgraded to a new Power 8 server and running AIX 7.1. I migrated from an IBM P520 and AIX 5.5. My application on the P520 works best if I direct print, it doesn't work well with spooling. My IBM rep set up the new Power 8 server with spooling which is causing an issue.... (4 Replies)
Discussion started by: ldavis1080
4 Replies
CURLOPT_FOLLOWLOCATION(3)				     curl_easy_setopt options					 CURLOPT_FOLLOWLOCATION(3)

NAME
CURLOPT_FOLLOWLOCATION - follow HTTP 3xx redirects SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FOLLOWLOCATION, long enable); DESCRIPTION
A long parameter set to 1 tells the library to follow any Location: header that the server sends as part of a HTTP header in a 3xx response. The Location: header can specify a relative or an absolute URL to follow. libcurl will issue another request for the new URL and follow new Location: headers all the way until no more such headers are returned. CURLOPT_MAXREDIRS(3) can be used to limit the number of redirects libcurl will follow. libcurl limits what protocols it automatically follows to. The accepted protocols are set with CURLOPT_REDIR_PROTOCOLS(3). By default libcurl will allow all protocols on redirect except those disabled for security reasons: Since 7.19.4 FILE and SCP are disabled, and since 7.40.0 SMB and SMBS are also disabled. When following a Location:, the 3xx response code that redirected it also dictates which request method it will use in the subsequent request: For 301, 302 and 303 responses libcurl will switch method to GET unless CURLOPT_POSTREDIR(3) instructs libcurl otherwise. All other 3xx codes will make libcurl send the same method again. For users who think the existing location following is too naive, too simple or just lacks features, it is very easy to instead implement your own redirect follow logic with the use of curl_easy_getinfo(3)'s CURLINFO_REDIRECT_URL(3) option instead of using CURLOPT_FOLLOWLOCA- TION(3). DEFAULT
0, disabled PROTOCOLS
HTTP(S) EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* example.com is redirected, so we tell libcurl to follow redirection */ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_perform(curl); } AVAILABILITY
Along with HTTP RETURN VALUE
Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_REDIR_PROTOCOLS(3), CURLOPT_PROTOCOLS(3), CURLOPT_POSTREDIR(3), CURLINFO_REDIRECT_URL(3), ,CURLINFO_REDIRECT_COUNT(3), libcurl 7.54.0 February 03, 2016 CURLOPT_FOLLOWLOCATION(3)
All times are GMT -4. The time now is 04:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy