regex - Redirect non-allowed IP's to specific page with .htaccess -


I have the following code, for example, to allow only some IPs to access the page.

  denies the order, 123.45.67.8 9 Allow all permissions to be denied from 123.45 & lt; Files ~ ". (Xml | jpe | g | png | gif | js) $" & gt; All & lt; / Files & gt; Allow  

.. But how can I show the user if the user is not allowed? As such, I want to redirect them to a certain page.

Put this code in your DOCUMENT_ROOT / Htaccess file:

  Rewrite code% {REQUEST_URI} on rewriting! \. (Xml | css | jpe? G | png | gif | js) $ [nc] rewrite% {REMOTE_ADDR}! ^ (123 \ .45 \ .19 \ .72 \ .48 \ .56) Rewrite% {REMOTE_ADDR}! ^ 53 \ .81 \ .21 \ .94 rewrite rules! ^ Maintenance $ Html / Maintenance.html [R = 302, L, NC]  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -