Skip to content

Instantly share code, notes, and snippets.

@abdumu
Last active October 19, 2017 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdumu/46dfa9c5dc813f911334a4367d7b8079 to your computer and use it in GitHub Desktop.
Save abdumu/46dfa9c5dc813f911334a4367d7b8079 to your computer and use it in GitHub Desktop.
Arabic maintenance page + htaccess redirect except your IP
<?php
#modifed version of https://gist.github.com/pitch-gist/2999707
//by twitter/abdu1m
#htaccess:
// RewriteCond %{REQUEST_URI} !/maintenance.php$
// RewriteCond %{HTTP:X-FORWARDED-FOR} !=151.254.68.111 #this is your ip
// RewriteRule $ /maintenance.php [R=302,L]
?>
<!doctype html>
<title>صيانة</title>
<style>
body { direction:rtl; text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Tahoma, sans-serif; color: #333; }
article { display: block; text-align: right; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
<article>
<h1>سوف نعود بعد قليل!</h1>
<div>
<p>عفواً، لكننا نقوم بعمل بعض أعمال الصيانة حالياً، كُن قريباً وسنعود بعد وقت قصير.</p>
<p>&mdash; فريق التطوير</p>
</div>
<?php /** one of these is you ip, use it in the htaccess file for redirect excpetion **/ ?>
<!-- <?=$_SERVER['HTTP_X_FORWARDED_FOR']?> -->
<!-- <?=$_SERVER['REMOTE_ADDR']?> -->
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment