<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>server security on Tutes Club</title><link>https://tutes.in/tag/server-security/</link><description>Recent content in server security on Tutes Club</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 02 Jan 2019 16:42:37 +0000</lastBuildDate><atom:link href="https://tutes.in/tag/server-security/index.xml" rel="self" type="application/rss+xml"/><item><title>How to secure a folder by whitelisting one IP using HTACCESS and denying all others</title><link>https://tutes.in/how-to-secure-a-folder-by-whitelisting-one-ip-using-htaccess-and-denying-all-others/</link><pubDate>Thu, 26 Oct 2017 22:19:06 +0000</pubDate><guid>https://tutes.in/how-to-secure-a-folder-by-whitelisting-one-ip-using-htaccess-and-denying-all-others/</guid><description>&lt;p&gt;The process involves matching all requests for an IP, if the IP does not match redirect all secured directory requests.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteCond %{REMOTE_ADDR} !^120\.120\.120\.120
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteRule ^admin/.* - [L,R=403]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteCond %{REMOTE_ADDR} ^120\.120\.120\.120
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteRule ^admin$ - [L,R=403]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you want to control this IP using a script, you can add 2 lines&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;###CUSTOM RULES###
# your rules will appear here using php script
###CUSTOM RULES###
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now add a script, say happy.php&lt;br&gt;
and use the following code:&lt;/p&gt;</description></item></channel></rss>