LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-10-2011, 11:04 PM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
How to redirect http request in squid ?


Hi,
In squid i have blocked some sites like facebook and youtube.I want to know is there any way when user type in his browser like www.facebook.com instead it show something like following it automatically redirect to www.google.com

Error
The requested URL could not be retrieved
The following error was encountered:
Access Denied.


Basically I want to redirect the http request so the user should not see the page not found error but www.google.com page may open automatically.

thanks
garden
 
Old 01-10-2011, 11:49 PM   #2
novice06
Member
 
Registered: Mar 2006
Location: Singapore
Distribution: RHEL, CentOS
Posts: 132

Rep: Reputation: 23
I believe you already configured your squid conf to block certain websites which you want to blacklist.
To redirect, here is quick and not elegant way.
change the content of /etc/squid/errors/ERR_ACCESS_DENIED with following

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Your Page Title</title>
<meta http-equiv="REFRESH" content="0;url=http://www.google.com"></HEAD>
<BODY>
</BODY>
</HTML>


Cheer
 
Old 01-11-2011, 12:14 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
well it is a good idea .Is there any other way to do it ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forcing http request through Squid Proxy Server(Transparent proxying) ochienged Linux - Server 5 06-02-2009 10:54 AM
redirect all http requests to a different squid proxy server r2d2#jedi Linux - Networking 1 05-27-2009 12:31 AM
redirect https request to http after user authentication r.r.vishwanath@gmail.com Linux - Newbie 1 01-31-2009 11:42 AM
redirect http request to https with "post method" FMH Linux - General 0 10-01-2007 02:16 AM
apache: http redirect for any request going to www.foo.com/* psychobyte Linux - Software 1 04-11-2005 05:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration