Im trying block websites in certain hours, but i cant use correctly the rewrite cond or what is the better way?
<IfModule rewrite_module>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.facebook.com$ [NC]
RewriteCond %{TIME_HOUR} ^(11|12|13|14|15)$
RewriteRule .? /restrinction_social.html [L]
</IfModule>
2
Answers
are you trying to block the website so you can internal network can not access it?
the .htaccess is for domains hosted on your server your configuration could work if your server is the host of facebook.com
if you are trying to block your internal network to access facebook.com maybe you can do it with DNS or a PROXY server like squid
You may try this procedure on how to block website on your network through httpd.conf.
Navigate to your Apache installation directory, which is typically the /etc/httpd/conf directory on most servers. The path to the installation directory is case-sensitive.
Locate the httpd.conf file in the conf directory, and then open using vi command or your text editor. You can use cp command to create a backup. Please see the sample below:
$ cp -R httpd.conf httpd.conf.bak
Scroll down to the “ProxyBlock” line.
Enter the domains you want to block in the “ProxyBlock” line. Add the domain name to block after the last domain name. You do not need to add a comma — just add a single space after the last blocked domain name. Please see the sample below:
Proxy Block google.com facebook.com
Hope this information works for you.