Kendi index.php dosyanızı yedekleyip aşağıda verdigim kodları wp kurulu oldugu dizine index.php olarak atın.
Google dışında gelen ziyaretçilere siteye giriş için tıklayın şeklinde bir index açacaktır.
<?php
function HHurl_origin( $s, $use_forwarded_host = false )
{
$ssl = ( ! empty( $s['HTTPS'] ) && $s['HTTPS'] == 'on' );
$sp = strtolower( $s['SERVER_PROTOCOL'] );
$protocol = substr( $sp, 0, strpos( $sp, '/' ) ) . ( ( $ssl ) ? 's' : '' );
$port = $s['SERVER_PORT'];
$port = ( ( ! $ssl && $port=='80' ) || ( $ssl && $port=='443' ) ) ? '' : ':'.$port;
$host = ( $use_forwarded_host && isset( $s['HTTP_X_FORWARDED_HOST'] ) ) ? $s['HTTP_X_FORWARDED_HOST'] : ( isset( $s['HTTP_HOST'] ) ? $s['HTTP_HOST'] : null );
$host = isset( $host ) ? $host : $s['SERVER_NAME'] . $port;
return $protocol . '://' . $host;
}
function HHfull_url( $s, $use_forwarded_host = false )
{
return HHurl_origin( $s, $use_forwarded_host ) . $s['REQUEST_URI'];
}
$absolute_url = HHfull_url( $_SERVER );
function HHcrawlerDetect($USER_AGENT)
{
$crawlers = array(
);
// to get crawlers string used in function uncomment it
// it is better to save it in string than use implode every time
// global $crawlers
$crawlers_agents = implode('|',$crawlers);
if (strpos($crawlers_agents, $USER_AGENT) === false){
return false;
}else {
return TRUE;
}
}
if(!HHcrawlerDetect($_SERVER['HTTP_USER_AGENT']) && (empty($_SERVER['HTTP_REFERER']) || empty($_SERVER['HTTP_USER_AGENT']))){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Siteye Giriş</title>
</head>
<body>
<h1 style="text-align:center"><a href="<?php echo $absolute_url;?>">Siteye Giriş İçin Tıklayınız.</a></h1>
</body>
</html>
<?php exit;}?><?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );Dipnot : ayrıca sunucuyu yöneten arkadaş apache loglarını incelerse sitenizde veya apache dosyaları üzerinden bir 404.shtml cagırıyor olabilir, buda olmadıgı için sorun yapar. Cpanel sunucularda oluyor bu genelde, bunu kontrol edip çağırılan dizinde 404.shtml dosyası yok ise oraya boş bir 404.shtml dosyası atmakta bir nebze işe yarayacaktır.
Merhaba hocam, sizin verdiğiniz kodlarda işe yaradı ama google siteme erişemiyor, bi çözümü var mı