Community discussions

 
phil1995
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 84
Joined: Fri Oct 26, 2007 5:54 am

Web Proxy Redirect to html file on router

Thu Sep 10, 2009 11:44 pm

I have set up a web proxy that blocks specific websites. I would like to redirect the default "Forbidden" to an html file stored on the router. Is this possible?

I was able to redirect to an external site, but could not get the path right to get to a file named "test.html" that I ftp'd up to the directory where my backup files are kept.

Any help would be greatly appreciated.
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1683
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Web Proxy Redirect to html file on router

Thu Sep 10, 2009 11:48 pm

hi, It's possible.

YOu have to put your html file in the router (like the path of login.html) and then redirect the error to routerIP/lalalala : P!
Martín
martinruiz at ibersystems.es
Experto en redes WiFi y enlaces WiFi.

Facebook: @Ibersystems
Twitter: @Ibersystems

Certified in Traffic Shaping, Wireless, Internetworking, Routing and User Management.
MTCTCE - MTCWE - MTCINE - MTCUME - MTCRE
 
phil1995
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 84
Joined: Fri Oct 26, 2007 5:54 am

Re: Web Proxy Redirect to html file on router

Thu Sep 10, 2009 11:51 pm

Thanks for the quick reply.

I tried that before, and it cant find the page.

Do I have the file in the right directory? If I just go to files in winbox, I can see the file there.

If I go to 192.168.3.2/test.html, I get page can not be displayed.

What is the path to the login.html, I dont see that file. How do I get to it?

I am not using a hotspot.
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1683
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Web Proxy Redirect to html file on router

Fri Sep 11, 2009 12:48 am

hi,


you need to make it with a hotspot. This enables the "html server" to show the custom file..

I don't know if it's possible to make without hotspot. I think that no.
Martín
martinruiz at ibersystems.es
Experto en redes WiFi y enlaces WiFi.

Facebook: @Ibersystems
Twitter: @Ibersystems

Certified in Traffic Shaping, Wireless, Internetworking, Routing and User Management.
MTCTCE - MTCWE - MTCINE - MTCUME - MTCRE
 
phil1995
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 84
Joined: Fri Oct 26, 2007 5:54 am

Re: Web Proxy Redirect to html file on router

Fri Sep 11, 2009 2:18 am

I have dropped a test.html file into the hotspot directory.

I can see the login page at 192.168.2.1/hotspot/login.html.

If I try to view the test file @ 192.168.2.1/hotspot/test.html, I just get page can not be found.

Why will it render one file, but not the other.
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1683
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Web Proxy Redirect to html file on router

Fri Sep 11, 2009 12:54 pm

hi,

it works, but I think is without /hotspot.
Martín
martinruiz at ibersystems.es
Experto en redes WiFi y enlaces WiFi.

Facebook: @Ibersystems
Twitter: @Ibersystems

Certified in Traffic Shaping, Wireless, Internetworking, Routing and User Management.
MTCTCE - MTCWE - MTCINE - MTCUME - MTCRE
 
kirshteins
MikroTik Support
MikroTik Support
Posts: 592
Joined: Tue Dec 02, 2008 10:55 am

Re: Web Proxy Redirect to html file on router

Fri Sep 11, 2009 1:53 pm

There is also a possibility to edit default web-proxy error page and not to use redirect
What's new in 3.28:
*) web proxy - allow to edit error page;
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1683
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Web Proxy Redirect to html file on router

Fri Sep 11, 2009 1:58 pm

Aps, ok.

I don't tryed this yet.. sorry : P
Martín
martinruiz at ibersystems.es
Experto en redes WiFi y enlaces WiFi.

Facebook: @Ibersystems
Twitter: @Ibersystems

Certified in Traffic Shaping, Wireless, Internetworking, Routing and User Management.
MTCTCE - MTCWE - MTCINE - MTCUME - MTCRE
 
phil1995
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 84
Joined: Fri Oct 26, 2007 5:54 am

Re: Web Proxy Redirect to html file on router

Fri Sep 11, 2009 4:01 pm

There is also a possibility to edit default web-proxy error page and not to use redirect
What's new in 3.28:
*) web proxy - allow to edit error page;


Where can I find "Whats new in 3.28"? Does it have documentation on how to edit the error page?
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24258
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Web Proxy Redirect to html file on router

Fri Sep 11, 2009 4:02 pm

this is from the changelog, changelog is on the download page. there are no instructions yet
No answer to your question? How to write posts
 
kirshteins
MikroTik Support
MikroTik Support
Posts: 592
Joined: Tue Dec 02, 2008 10:55 am

Re: Web Proxy Redirect to html file on router

Fri Sep 11, 2009 4:06 pm

Where can I find "Whats new in 3.28"?
http://www.mikrotik.com/download/CHANGELOG_3
Does it have documentation on how to edit the error page?
Just download webproxy/error.html file form webproxy folder located on your router. Edit it as a standart HTML file. And upload it back where it was.
 
phil1995
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 84
Joined: Fri Oct 26, 2007 5:54 am

Re: Web Proxy Redirect to html file on router

Fri Sep 11, 2009 4:09 pm

thank you
 
User avatar
NAB
Trainer
Trainer
Posts: 503
Joined: Tue Feb 10, 2009 4:08 pm
Location: UK
Contact:

Re: Web Proxy Redirect to html file on router

Sun May 23, 2010 10:20 pm

Just download webproxy/error.html file form webproxy folder located on your router. Edit it as a standart HTML file. And upload it back where it was.
Worth pointing out that that file doesn't appear automatically (at least on any system I've tried it on) and I had to click on 'Reset HTML' in the web proxy settings window in Winbox.

I notice that the page http://wiki.mikrotik.com/wiki/Manual:IP/Proxy covers a lot of the settings, but not all - why does "cache-hit-dscp", for example, not have a description?

That page also does not cover the content of the file webproxy/error.html. On my system it is created with the following content:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ERROR: $(status)</title></head>
<body><h2>ERROR: $(status)</h2>
<hr noshade size="1px"/>
$(if error)
<p>While trying to retrieve the URL <a href="$(url)">$(url)</a>:</p>
<ul><li><strong>$(error)</strong></li></ul>
$(endif)
<p>Your cache administrator is <a href="mailto:$(admin)">$(admin)</a>.
$(signature)
</body></html>
and I have the following questions:
  1. Why is there a section in an 'if error' clause? Is there any condition where the error.html file which says "ERROR" in it isn't an error and this clause does not apply?
  2. What are the possible options for '$(status)' - it would be nice to edit that page to have some explanation for the user.
  3. Where is '$(signature)' defined? I would like to be able to remove 'Mikrotik HttpProxy' from the message to make it more personalised for the end user.
Nicholas Barnes BSc(hons)
Certified Mikrotik Consultant
Certified Mikrotik Trainer

Vitell - Asterisk, Linux and network consultants
Unofficial IRC channel: #routerboard on irc.z.je

Who is online

Users browsing this forum: No registered users and 25 guests