2016-01-29 30 views
4

當我在我的網站上運行SEO Site Checkup我得到:IP規範化(WordPress的)

IP規範化測試:你的網站的IP不重定向到您的網站的域名。如果搜索引擎根據其IP和域名爲您的網站建立索引,這可能會導致重複的內容問題。

我運行Apache,而該意見是對以下內容添加到我的.htaccess文件:

RewriteCond %{HTTP_HOST} ^XXX\.XXX\.XXX\.XXX 
RewriteRule (.*) http://www.example.com/$1 [R=301,L] 

使用this test,我發現我的站點有2個IP地址,所以我添加重寫引擎部分有兩條規則。但該網站仍未通過測試。

我正在做這個對嗎?這是我的.htaccess文件:

# BEGIN W3TC Browser Cache 
<IfModule mod_deflate.c> 
    <IfModule mod_headers.c> 
     Header append Vary User-Agent env=!dont-vary 
    </IfModule> 
     AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json 
    <IfModule mod_mime.c> 
     # DEFLATE by extension 
     AddOutputFilter DEFLATE js css htm html xml 
    </IfModule> 
</IfModule> 
# END W3TC Browser Cache 
# BEGIN W3TC Page Cache core 
<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/
    RewriteCond %{HTTP:Accept-Encoding} gzip 
    RewriteRule .* - [E=W3TC_ENC:_gzip] 
    RewriteCond %{HTTP_COOKIE} w3tc_preview [NC] 
    RewriteRule .* - [E=W3TC_PREVIEW:_preview] 
    RewriteCond %{REQUEST_METHOD} !=POST 
    RewriteCond %{QUERY_STRING} ="" 
    RewriteCond %{REQUEST_URI} \/$ 
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC] 
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f 
    RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L] 
</IfModule> 
# END W3TC Page Cache core 
# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
RewriteCond %{HTTP_HOST} ^104\.24\.122\.248 
RewriteRule (.*) http://www.example.com/$1 [R=301,L] 
RewriteCond %{HTTP_HOST} ^104\.24\.123\.248 
RewriteRule (.*) http://www.example.com/$1 [R=301,L] 
</IfModule> 

# END WordPress 

感謝

回答

1

你需要的WordPress調度之前把那些臺詞:

# BEGIN Redirect IP to domain name 
<ifModule mod_rewrite.c> 
    RewriteCond %{HTTP_HOST} ^104\.24\.122\.248 [OR] 
    RewriteCond %{HTTP_HOST} ^104\.24\.123\.248 
    RewriteRule (.*) http://www.londoncitymedia.com/$1 [R=301,L] 
</IfModule> 
# END Redirect IP to domain name 

# BEGIN W3TC Browser Cache 
<IfModule mod_deflate.c> 
    <IfModule mod_headers.c> 
     Header append Vary User-Agent env=!dont-vary 
    </IfModule> 
     AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json 
    <IfModule mod_mime.c> 
     # DEFLATE by extension 
     AddOutputFilter DEFLATE js css htm html xml 
    </IfModule> 
</IfModule> 
# END W3TC Browser Cache 

# BEGIN W3TC Page Cache core 
<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/
    RewriteCond %{HTTP:Accept-Encoding} gzip 
    RewriteRule .* - [E=W3TC_ENC:_gzip] 
    RewriteCond %{HTTP_COOKIE} w3tc_preview [NC] 
    RewriteRule .* - [E=W3TC_PREVIEW:_preview] 
    RewriteCond %{REQUEST_METHOD} !=POST 
    RewriteCond %{QUERY_STRING} ="" 
    RewriteCond %{REQUEST_URI} \/$ 
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC] 
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f 
    RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L] 
</IfModule> 
# END W3TC Page Cache core 

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/
    RewriteRule ^index\.php$ - [L] 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule . /index.php [L] 
</IfModule> 
# END WordPress 
+0

您正在使用雲耀斑。你看到的IP是Cloud Flare的IP,而不是你的IP。您的真實IP爲213.171.193.5女巫無法訪問。你在這方面沒有什麼可做的。 –

+0

謝謝弗洛裏安。這是否意味着我無法對SEO分數做任何事情?我有權訪問CloudFlare。有什麼我可以在那裏做的? – Seano

+1

你無事可做。您通過此測試是因爲您的真實IP無法訪問,但此工具缺乏像Cloud Flare一樣檢測CDN的能力。這是這個工具的問題,而不是你的搜索引擎優化的問題;) –