0

Tamamen kafam karıştı.CodeIgniter 404 Routing - 404 kırık linkler ve google tarama sitesi için yetersizlik ama her şey yolunda görünüyor

Ben O CodeIgniter platformu üzerine inşa edilmiştir http://citylightstours.com

siteyi çalıştırın.

Google Search Console'da, sitemin yalnızca 1 sayfasının Google'da dizine eklendiğini fark ettim. Diğer tüm sayfalarda 404 hata vardı ve dolayısıyla google onları listelemedi. Ben bu nedenle hatalı bir site haritası olduğunu düşünmüş

yüzden yeni bir tane oluşturmak için https://www.xml-sitemaps.com/ gitti. Ben kök url koydum ve sürpriz sadece blog girişleri oluşturulan xml sitemap içerdi - sitemde ana sayfaların YOK vardı!

Bu nedenle kırık bağlantılar http://www.brokenlinkcheck.com/ için ve benim ekstra sürpriz kontrol etmek başka bir siteye gitti sitemde her sayfa 404 kırık link durumunu vardı. NASIL, bu linklere tıklayarak geçerli bir sayfa görüntüler. Bu nedenle bunlar bozuk bağlantılar değildir ve siteyi iyi seyredebilirim.

Bu nedenle otomatik robotlar bir 404'ler listesinde ve alışkanlık endeksi sitesi ile gelen neden tüm bağlantılar çalışmaya göründüğünde, anlamıyorum! ???

Herhangi bir fikrin var mı?

THanks

GÜNCELLEME: yaptığım çalıştı bir Getir ve tarayıcılarda görüntülenen geçerli bir sayfa bir Bulunamadı hata veriyor ve çok arama konsolundan Render!

GÜNCELLEME 2: site yaptıktan sonra: google citylightstours.com i endeksli SADECE sayfalar blog sayfaları olduğunu fark. Diğer tüm sayfalar dizinden düştü - herhangi bir fikir neden ???

GÜNCELLEME 3: yorumlardan biri i birisi bir şey görür umuduyla burada ilanıyla böylece .htaccess ile bir sorun olabilir önerdi. Teşekkürler

GÜNCELLEME 4: Bu yazıyı okuduktan sonra enter link description here Sunucunun, 404 insan okunabilir iletisi olarak gerçek sayfa koduyla 404 hatası döndürdüğünü düşünüyorum! Dediğim gibi, özel bir 404 sayfa ve yönlendirme ile ilgili bir şey olması için codeigniter kullanıyorum. Buna rağmen nasıl hata ayıklanacağımı bilmiyorum. Biri yardım edebilir mi ... ... TEŞEKKÜRLER!

<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 geliştirici konsolu, herhangi bir sayfa için chrome tarayıcınızda 404 hatası gösteriyor. yanınızda sorun olabilir gibi i krom geliştirici konsolunu kullanarak birkaç sayfalarda kontrol ve herhangi 404 hataları görmek – Zeeshan

+0

bunu chk. Bu blogu eklemeden önce tüm sayfaları dizine ekledim. siteyi yazdığımda: google'da citylightstours.com, dizine eklenen tek sayfalar bloglardır. herhangi bir fikrin ne sebep olabilir ?? –

+0

Ben sitede wordpress blog ile ilgili bir şey var gelmiyordu –

cevap

0

Çözüldü - sitede entegre wordpress blog olmayan tüm wordpress sayfaları için 404 statüsünü batıyordu yani CodeIgniter'ın sayfalar

CI

index.php

dışarı yorumladı gereken aşağıdaki kodu vardı
/* 
*--------------------------------------------------------------- 
* 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']; 
    }