0

私は全く混乱しています。CodeIgniter 404ルーティング - 404リンクが壊れていて、Googleがサイトをクロールできないのですが、すべてがOKです。

私はそれはCodeIgniterのプラットフォーム上に構築されているサイトhttp://citylightstours.com

を実行します。

Google検索コンソールでは、自分のサイトの1ページしかGoogleでインデックスされていないことに気づきました。他のすべてのページには404エラーがあったため、Googleではそれらをリストしませんでした。

私はそれが間違ったサイトマップだと思ったので、新しいものを生成するためにhttps://www.xml-sitemaps.com/に行きました。私はルートのURLに入れて、私の驚きにはブログのエントリだけが生成されたXMLサイトマップに含まれていた - 私のサイトのメインページはありませんでした!

したがって私は壊れたリンクhttp://www.brokenlinkcheck.com/を確認するために別のサイトに行きました。私の余計なことに、私のサイトのすべてのページは404のリンクが切れています。しかし、それらのリンクをクリックすると有効なページが表示されます。したがってリンクは壊れていないので、サイトをうまくナビゲートできます。

私は、なぜ自動化されたロボットが404のリストを持っていて、すべてのリンクが動作するように見える場合、サイトのインデックスを作成しないのか理解していません。

アイデア?

おかげ

UPDATE:私はやってみました取得し、ブラウザに表示されている有効なページが見つかりませんエラーを与え、あまりにも検索コンソールからレンダリング!

更新2:sitelightstours.comをGoogleで実行した後、インデックス付きのページはブログページのみです。他のすべてのページはインデックスから抜け出しています。

UPDATE 3:コメントの1つは.htaccessに問題がある可能性があることを示唆しているので、誰かが何かを狙っていることをここに掲載しています。ありがとう

更新4:この投稿を読んだ後enter link description here私は、サーバーが実際のページコードを404の人間の読めるメッセージとして404エラーを返すかもしれないと思う!私が言ったように、私はcodeigniterを使用するので、カスタム404ページとルーティングと何か関係があります。私はどのようにこれをデバッグするか、何を見るかを知らない。誰も助けることができる?...ありがとう!

解決
<IfModule mod_rewrite.c> 
# Development 
    RewriteEngine On 
    RewriteBase/
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond $1 !^(index\.php|images|scripts|styles|vendor|robots\.txt) 
    RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] 


# ---------------------------------------------------------------------- 
# Better website experience for IE users 
# ---------------------------------------------------------------------- 

<IfModule mod_setenvif.c> 
    <IfModule mod_headers.c> 
    BrowserMatch MSIE ie 
    Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie 
    </IfModule> 
</IfModule> 

<IfModule mod_headers.c> 
    Header append Vary User-Agent 
</IfModule> 


# ---------------------------------------------------------------------- 
# Webfont access 
# ---------------------------------------------------------------------- 

<FilesMatch "\.(ttf|otf|eot|woff|font.css)$"> 
    <IfModule mod_headers.c> 
    Header set Access-Control-Allow-Origin "*" 
    </IfModule> 
</FilesMatch> 

# ---------------------------------------------------------------------- 
# Proper MIME type for all files 
# ---------------------------------------------------------------------- 

# audio 
AddType audio/ogg      oga ogg 

# video 
AddType video/ogg      .ogv 
AddType video/mp4      .mp4 
AddType video/webm      .webm 

# Proper svg serving. Required for svg webfonts on iPad 
# twitter.com/FontSquirrel/status/14855840545 
AddType  image/svg+xml    svg svgz 
AddEncoding gzip      svgz 

# webfonts        
AddType application/vnd.ms-fontobject eot 
AddType font/truetype     ttf 
AddType font/opentype     otf 
AddType application/x-font-woff  woff 

# assorted types          
AddType image/x-icon     ico 
AddType image/webp      webp 
AddType text/cache-manifest   appcache manifest 
AddType text/x-component    htc 
AddType application/x-chrome-extension crx 
AddType application/x-xpinstall  xpi 
AddType application/octet-stream  safariextz 

# ---------------------------------------------------------------------- 
# gzip compression 
# ---------------------------------------------------------------------- 

<IfModule mod_deflate.c> 

<IfModule mod_setenvif.c> 
    <IfModule mod_headers.c> 
    SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s,?\s(gzip|deflate)?|X{4,13}|~{4,13}|-{4,13})$ HAVE_Accept-Encoding 
    RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding 
    </IfModule> 
</IfModule> 

<FilesMatch "^(?!.*\.ogg$|.*\.ogv$|.*\.mp4$).+" > 

# html, txt, css, js, json, xml, htc: 
<IfModule filter_module> 
    FilterDeclare COMPRESS 
    FilterProvider COMPRESS DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/ 
    FilterProvider COMPRESS DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/ 
    FilterChain  COMPRESS 
    FilterProtocol COMPRESS change=yes;byteranges=no 
</IfModule> 
</FilesMatch> 

# webfonts and svg: 
    <FilesMatch "\.(ttf|otf|eot|svg)$" > 
    SetOutputFilter DEFLATE 
    </FilesMatch> 
</IfModule> 

# ---------------------------------------------------------------------- 
# Expires headers (for better cache control) 
# ---------------------------------------------------------------------- 

<IfModule mod_expires.c> 
    ExpiresActive on 

# Perhaps better to whitelist expires rules? Perhaps. 
    ExpiresDefault       "access plus 1 month" 

# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5) 
    ExpiresByType text/cache-manifest  "access plus 0 seconds" 

# your document html 
    ExpiresByType text/html     "access plus 0 seconds" 

# data 
    ExpiresByType text/xml     "access plus 0 seconds" 
    ExpiresByType application/xml   "access plus 0 seconds" 
    ExpiresByType application/json   "access plus 0 seconds" 

# rss feed 
    ExpiresByType application/rss+xml  "access plus 1 hour" 

# favicon (cannot be renamed) 
    ExpiresByType image/x-icon    "access plus 1 week" 

# media: images, video, audio 
    ExpiresByType image/gif     "access plus 1 month" 
    ExpiresByType image/png     "access plus 1 month" 
    ExpiresByType image/jpg     "access plus 1 month" 
    ExpiresByType image/jpeg    "access plus 1 month" 
    ExpiresByType video/ogg     "access plus 1 month" 
    ExpiresByType audio/ogg     "access plus 1 month" 
    ExpiresByType video/mp4     "access plus 1 month" 
    ExpiresByType video/webm    "access plus 1 month" 

# htc files (css3pie) 
    ExpiresByType text/x-component   "access plus 1 month" 

# webfonts 
    ExpiresByType font/truetype    "access plus 1 month" 
    ExpiresByType font/opentype    "access plus 1 month" 
    ExpiresByType application/x-font-woff "access plus 1 month" 
    ExpiresByType image/svg+xml    "access plus 1 month" 
    ExpiresByType application/vnd.ms-fontobject "access plus 1 month" 

# css and javascript 
    ExpiresByType text/css     "access plus 2 months" 
    ExpiresByType application/javascript "access plus 2 months" 
    ExpiresByType text/javascript   "access plus 2 months" 

    <IfModule mod_headers.c> 
    Header append Cache-Control "public" 
    </IfModule> 

</IfModule> 

# ---------------------------------------------------------------------- 
# ETag removal 
# ---------------------------------------------------------------------- 

FileETag None 

# ---------------------------------------------------------------------- 
# Stop screen flicker in IE on CSS rollovers 
# ---------------------------------------------------------------------- 

# The following directives stop screen flicker in IE on CSS rollovers - in 
# combination with the "ExpiresByType" rules for images (see above). If 
# needed, un-comment the following rules. 

# BrowserMatch "MSIE" brokenvary=1 
# BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1 
# BrowserMatch "Opera" !brokenvary 
# SetEnvIf brokenvary 1 force-no-vary 

RewriteEngine On 
RewriteCond %{HTTP_HOST} !^citylightstours\.com$ [NC] 
RewriteRule ^(.*)$ http://citylightstours.com/$1 [R=301,L] 
RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
RewriteRule .* ? [F,L] 
+0

クロムブラウザのChkデベロッパーコンソールで、404ページのエラーが表示されます。 あなたの側に問題がある可能性がありますので、 – Zeeshan

+0

クロム開発者のコ​​ンソールを使用していくつかのページをチェックしても404エラーは表示されませんでした –

+0

私はそれがサイトのワードプレスのブログと関係があると思います。私はこのブログを追加する前にすべてのページのインデックスを作成しました。私がsite:citylightstours.comをgoogleに入力すると、索引付けされる唯一のページはブログのものです。どのような考えがこれを引き起こす可能性がありますか? –

答えて

0

- サイトに統合ワードプレスのブログは、すべての非ワードプレスのページのための404のステータスを設定したCIのCodeIgniterのページ

のindex.phpをIEが

をコメントアウトするために必要な次のコードを持っていました
/* 
*--------------------------------------------------------------- 
* WORDPRESS INTEGRATION 
*--------------------------------------------------------------- 
* The ci_site_url function helps to avoid collision between WP & CI. 
*/ 

//header("HTTP/1.0 200 OK"); 

define('WP_USE_THEMES', false); 
require_once './blog/wp-blog-header.php'; 

add_filter('site_url', 'ci_site_url', 1); 

    function ci_site_url() 
    { 
    include(APPPATH.'/config/config.php'); 
    return $config['base_url']; 
    } 
関連する問題