Information Technology Center, The University of Tokyo

Campus-wide Computing Research Division

Home > Campus-wide Computing Research Division > Services > WEB PARK > FAQ > ■Is it possible to restrict access on WEB PARK?

■Is it possible to restrict access on WEB PARK?

Yes, it is possible to restrict access by changing the settings of mod_rewrite, and .htaccess.


Example of .htaccess to restrict access only within the campus network

If you want to restrict access at simultaneously, you should write the following .htaccess file.

#Example of a case where you want to restrict access to at the same time
RewriteEngine On
# Access to
#- Allowed if access is directly from within the campus network
RewriteCond %{HTTP:X-REAL-IP} ^(133.11.|130.69.|157.82.)

# – Allow access without evaluating subsequent conditions
RewriteRule .* – [L]

# Access to
# – not from on-campus => access from off-campus or
RewriteCond %{HTTP:X-PARKSSL-Forwarded-For} !^(133.11.|130.69.|157.82.) [OR]

# – not accessed via park.itc proxy => direct access or proxy at another site
RewriteCond %{HTTP:X-REAL-IP} !^($

# – Access is not allowed if either of the above two conditions applies
RewriteRule .* – [F]

However, it is not possible to specify Options. ([Internal Server Error] (* see below) will sometimes be displayed. Please take extra care when setting up, as if you make a mistake when setting up, you may end up not being able to gain access.)

For details of each functions, please refer to SAKURA’s internet manual.