LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to redirect http request in squid ? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-redirect-http-request-in-squid-855485/)

gardenair 01-10-2011 11:04 PM

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

novice06 01-10-2011 11:49 PM

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

gardenair 01-11-2011 12:14 AM

well it is a good idea .Is there any other way to do it ?


All times are GMT -5. The time now is 04:35 PM.