Restrict access to web pages

Access to web pages can be restricted by IP address or by UGent account via CAS.


Restricting by IP address

Shielding web pages based on IP address can be done by placing a .htaccess file with rules in your web space. The dot before ".htaccess" indicates that it is a hidden file on Unix operating systems, so it is not shown in normal directory listings.

The rules in the file apply to all underlying directories. If you only want to shield a deeper directory, place the file directly in that directory.

Some examples of rules:


Allow ip address:

Require ip 157.193.49.81

Allow multiple ip addresses:

# several lines with one address
Require ip 157.193.49.80
Require ip 157.193.49.81
# line with several addresses
Require ip 157.193.49.82 157.193.49.83

Allowing full ip range:

# with a network mask
# ugent
Require ip 157.193.0.0/255.255.0.0
# eduroam
Require ip 172.18.0.0/255.255.255.0
# variant by specifying only the common part
Require ip 157.193.1
# this is similar to
Require ip 157.193.1.0/255.255.255.

More info


Restricting based on UGent account

With CAS, UGent's Central Authentication Service, you can make web pages accessible only to users with a UGent account.

Easily activate CAS authentication on webhares.