31. March 2011
von Blackbam

Development projects should not be visible for public internet visitors in a lot of cases. Imagine you develop a project for a large company and the Google robots get you for some reason. There will be a lot of visitors who surf on your unfinished blog or website. There are a lot of Maintenence Plugins for WordPress, like WP Maintenance Mode, but this is not so good for development, as you have to be logged in all the time.

A good way to protect you from unwanted visitors is using an IP-Filter. You can do this using PHP or a configuration-file for your webserver. I like the PHP way, because it is possible kind of server. Now only you or somebody using your IP-Address will be able to see the site. Everybody else is forwarded to another site. Just copy and paste the following code at the beginning of your index.php-file in the WordPress root folder on the server:

Using PHP
/*** The IP-protectection for development time ****/
$userip = ($_SERVER['REMOTE_ADDR']); // The IP of the visitor
$ip = '127.0.13.37'; // Enter your IP here

if ($userip != $ip) {
	header("Location:http://www.company.old/"); // the URL of another site, take Google for example
} else{
	// do nothing, go on to wordpress
}

Another way is using a server configuration, like .htaccess on Apache:

Apache example
Order deny,allow
deny from all
allow from 94.136.31.33

Somebody who knows your IP-Address still can get in, so if security is really important, you should add some more security measures.

Share

Warning: Undefined variable $time_since in /home/.sites/609/site1266/web/blackbams-blog/wp-content/themes/SilentWoodsByBlackbam/single.php on line 42 Dieser Eintrag wurde am 31. March 2011 um 20:20 in der Kategorie WordPress, WP Scripts veröffentlicht. You can book the comments for this article RSS 2.0. Feedback, discussion, commendation and critics are welcome: Write a comment or trackback.


Tags: , ,

Fatal error: Uncaught Error: Undefined constant "Ext_related_links" in /home/.sites/609/site1266/web/blackbams-blog/wp-content/themes/SilentWoodsByBlackbam/single.php:75 Stack trace: #0 /home/.sites/609/site1266/web/blackbams-blog/wp-includes/template-loader.php(106): include() #1 /home/.sites/609/site1266/web/blackbams-blog/wp-blog-header.php(19): require_once('/home/.sites/60...') #2 /home/.sites/609/site1266/web/blackbams-blog/index.php(17): require('/home/.sites/60...') #3 {main} thrown in /home/.sites/609/site1266/web/blackbams-blog/wp-content/themes/SilentWoodsByBlackbam/single.php on line 75 internal_server_error <![CDATA[WordPress &rsaquo; Error]]> 500