5

Allow access to the website only at specific times?

 2 years ago
source link: https://www.codesd.com/item/allow-access-to-the-website-only-at-specific-times.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Allow access to the website only at specific times?

advertisements

Is it possible to restrict the access to a html/php website only at specific times? I have a php file on my Raspberry Pi and I already set up a .htaccess file so that users have to log in, but I also want to restrict the times of access. Users should only be able to access (or log in) the page between 7am and 1pm.

Since I have root access to my Raspberry Pi, I kind of have infinite possibilities to do so (apache2, html, css, javascript, php, ...)


You could redirect users to a different page if the time criteria isn't met with the Apache Rewrite mod. The below will issue a 403 if the time is later than 1300 and before 0700.

RewriteEngine On
RewriteCond %{TIME_HOUR} >= 13 [OR]
RewriteCond %{TIME_HOUR} < 07
RewriteRule ^/site.html - [F]

Related Articles

Allow access to the website only at specific IPs using JavaScript / jQuery

Could you please give me hint or sample code for restricting access to website to only specific IP addresses using no more or less than JS / jQuery? I found a lot of examples for other methods like htaccess or so, but not for JSYou can't achieve this

Allow access to the website only from a specific network

I'm making a website that appeals to students at my school. I want to only allow access if the user is on the campus wifi or hardwire. Using PHP, how can I restrict access to people I am sure are on the campus internet?You would need to get a range o

Allow access to the file only from specific Lambda [s3]

A s3 bucket (static web hosting) have a certain policy that deny access to everyone concerning a certain file. How can I allow only a specific lambda function to access it ? (using only the bucket policy) { "Version": "2012-10-17", &qu

Is it possible to restrict access to the website to a specific computer?

Note: I am not asking how to limit asking to a site by means of a static IP address, this is already done in my .htaccess file. I have a particular site I will need to access on the road often but will only be doing so from a particular machine. In s

Can I block access to the network for a specific time?

Writing an iOS app, I neet to give the user the option to block the network access for this app only. Is it possible doing that in code? Meaning every call, made by whatever part of the code (and that's including static libraries) should be blocked f

Block the website for a specific time slot (maintenance activity)

How do i block of page requests to the website , and make it unavailable (redirect to an error page) for a specific time slot?You can place a file named app_offline.htm in the root directory of your ASP.NET website and ASP.NET will automatically rout

Web.config allows access to the site for a specific user

I have a webserver from where users can download files that are specific for each user. To be sure each user can only download its own files they must authenticate via Basic-Authentication. So for each user there is a windows-account on the server th

Prevent indirect access to the website in PHP

I have a query. Is there a way to detect whether the website is accessed directly or in-directly? Let me make my question more clear to you with an example. Let's say I have an Image sharing website. When an user opens the website and views an image,

Limit access to the aws instance from specific IP

I want to set the security groups for the web server running in aws instance.My website should be accessible to through http/https. But file modification access to be set to particular IP address.I am currently connected to a Wifi router, and as I kn

allowing access to the development site via htaccess

I have inherited a prestashop website and the htaccess file is set up for all the required redirects. I want to allow access to the dev subdomain but the htaccess keeps redirecting to main site. I have tried to allow access with my limited knowledge

How to deny access to the website based on the user's email address

Good Morning, I'm starting a PHP/MySQL project that will include a registration page where the user will be prompted to enter their email address. The requirement is that certain email address domains will not be permitted access to the website. We w

Translate the website into a specific language, loading the page

Anybody have any idea how to translate a web page into any language using Google translate when it loads? I don't want a drop down menu, I just want to convert the website into a specific language when it loads. I have tried many things from http://c

Using php to display the object at a specific time

This may seem like a simple thing but I just can't get my head around it. How do I use php to display a div on a website at a specific time for only a duration? Eg. Show object for 10min every hr. Ok, I have an object ie ahajsjajshaksjaksjiajsns whic

Nodejs, express, Ajax: the function only triggers Six Times

using nodejs and express I'm trying to trigger a js function which contains a simple console log. Sadly the function only triggers 6 times and freezes for a while. After a minute or two all the button clicks which where clicked during the "frozen tim

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK