Advertisement
rAthus

.htaccess : rediriger toutes les IP vers un dossier sauf une

Feb 5th, 2015
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. # Dans cet exemple, tout IP autre que "11.22.33.444" arrivant à la racine se voit afficher le contenu du dossier "/old" :
  2.  
  3. RewriteEngine On
  4.  
  5. RewriteCond %{REMOTE_HOST} !^11\.22\.33\.444
  6. RewriteCond %{REQUEST_URI} !^/old
  7. RewriteCond %{DOCUMENT_ROOT}/old%{REQUEST_URI} -d
  8. RewriteRule ^(.*?)/?$ /old/$1/ [L]
  9.  
  10. RewriteCond %{REMOTE_HOST} !^11\.22\.33\.444
  11. RewriteCond %{REQUEST_URI} !^/old
  12. RewriteRule ^(.*)$ /old/$1 [L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement