Advertisement
suprianto

redirectucub

Nov 15th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #!/usr/bin/perl
  2. $|=1;
  3. while (<>) {
  4. chomp;
  5. @X = split;
  6. $url = $X[0];
  7. if ($url =~ m/^https:\/\/.*\.youtube\.com/) {
  8. print "OK status=302 url=http://www.youtube.com\n"
  9. #print "OK rewrite-url=http://www.youtube.com\n";
  10. } else {
  11. print "ERR\n";
  12. }
  13. }
  14.  
  15.  
  16. Config squidnya:
  17. #Redirect ucub
  18. acl ucub dstdomain .youtube.com
  19. url_rewrite_access allow ucub
  20. url_rewrite_program /etc/squid/redirectucub.pl
  21. url_rewrite_children 7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement