2016-05-30 5 views
0

Dies funktioniert: example.com/24.htaccess Umleitung Indexseite nicht Cache prerender.io (aber umleitet subpages)

Dies gilt nicht: example.com

Ich bin mir nicht sicher, ob die Problem in htaccess oder in Apache conf.

.htaccess Code

 <IfModule mod_headers.c> 
      RequestHeader set X-Prerender-Token "xxxxxxxxxxxxx" 
     </IfModule> 

     <IfModule mod_rewrite.c> 
      RewriteEngine on 

      # Redirect www to non-www 
      RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] 
      RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 

      Options +FollowSymLinks 
      #RewriteRule ^api/(.*)$ http://vivule.ee/api/$1 [P,L] 

      # Don't rewrite files or directories, but exclude adminer directory 
      RewriteRule ^(adminer)($|/) - [L] 
      RewriteCond %{REQUEST_FILENAME} -f 
      RewriteRule^- [L] 

      # Prerender.io stuff 
      <IfModule mod_proxy_http.c> 
       RewriteCond %{HTTP_USER_AGENT} Googlebot|bingbot|Googlebot-Mobile|Baiduspider|Yahoo|YahooSeeker|DoCoMo|Twitterbot|TweetmemeBot|Twikle|Netseer|Daumoa|SeznamBot|Ezooms|MSNBot|Exabot|MJ12bot|sogou\sspider|YandexBot|bitlybot|ia_archiver|proximic|spbot|ChangeDetection|NaverBot|MetaJobBot|magpie-crawler|Genieo\sWeb\sfilter|Qualidator.com\sBot|Woko|Vagabondo|360Spider|ExB\sLanguage\sCrawler|AddThis.com|aiHitBot|Spinn3r|BingPreview|GrapeshotCrawler|CareerBot|ZumBot|ShopWiki|bixocrawler|uMBot|sistrix|linkdexbot|AhrefsBot|archive.org_bot|SeoCheckBot|TurnitinBot|VoilaBot|SearchmetricsBot|Butterfly|Yahoo!|Plukkie|yacybot|trendictionbot|UASlinkChecker|Blekkobot|Wotbox|YioopBot|meanpathbot|TinEye|LuminateBot|FyberSpider|Infohelfer|linkdex.com|Curious\sGeorge|Fetch-Guess|ichiro|MojeekBot|SBSearch|WebThumbnail|socialbm_bot|SemrushBot|Vedma|alexa\ssite\saudit|SEOkicks-Robot|Browsershots|BLEXBot|woriobot|AMZNKAssocBot|Speedy|oBot|HostTracker|OpenWebSpider|WBSearchBot|FacebookExternalHit [NC,OR] 
       RewriteCond %{QUERY_STRING} _escaped_fragment_ 

       # Only proxy the request to Prerender if it's a request for HTML 
       RewriteRule ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent))(.*) http://service.prerender.io/http://vivule.ee/$2 [P,L] 
      </IfModule> 

      # Rewrite everything else to index.html to allow html5 state links 
      RewriteRule ^adminer - [L,NC] 
      RewriteRule^index.html [L] 

     </IfModule> 

Ich bin mit dieser Prüfung: https://developers.facebook.com/tools/debug/og/object/

Problem Homepage: http://vivule.ee/

Antwort

1

Ok, hier ist, wie ich es gelöst habe. Es stellt sich heraus, dass das Problem bei der Einrichtung von Apache 2.4 liegt. Aus irgendeinem Grund umgeht es Prerrender-Server und liefert Roh-HTML vom Original-Server. Ich habe es gelöst, indem ich "DirectoryIndex" in die htaccess-Datei eingefügt habe. Keine Parameter hinzugefügt, dies setzt den Seitenindex auf http://example.com/.

Hier ist meine letzte Code ist:

 <IfModule mod_headers.c> 
      RequestHeader set X-Prerender-Token "XXXXXXXXXXXX" 
     </IfModule> 

     <IfModule mod_rewrite.c> 
      DirectoryIndex 
      RewriteEngine on 

      # Redirect www to non-www 
      RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] 
      RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 

      Options +FollowSymLinks 
      #RewriteRule ^api/(.*)$ http://vivule.ee/api/$1 [P,L] 


      # Prerender.io stuff 
      <IfModule mod_proxy_http.c> 
       RewriteCond %{HTTP_USER_AGENT} Baiduspider|DoCoMo|Twitterbot|TweetmemeBot|Twikle|Netseer|Daumoa|SeznamBot|Ezooms|MSNBot|Exabot|MJ12bot|sogou\sspider|bitlybot|ia_archiver|proximic|spbot|ChangeDetection|NaverBot|MetaJobBot|magpie-crawler|Genieo\sWeb\sfilter|Qualidator.com\sBot|Woko|Vagabondo|360Spider|ExB\sLanguage\sCrawler|AddThis.com|aiHitBot|Spinn3r|BingPreview|GrapeshotCrawler|CareerBot|ZumBot|ShopWiki|bixocrawler|uMBot|sistrix|linkdexbot|AhrefsBot|archive.org_bot|SeoCheckBot|TurnitinBot|VoilaBot|SearchmetricsBot|Butterfly|Yahoo!|Plukkie|yacybot|trendictionbot|UASlinkChecker|Blekkobot|Wotbox|YioopBot|meanpathbot|TinEye|LuminateBot|FyberSpider|Infohelfer|linkdex.com|Curious\sGeorge|Fetch-Guess|ichiro|MojeekBot|SBSearch|WebThumbnail|socialbm_bot|SemrushBot|Vedma|alexa\ssite\saudit|SEOkicks-Robot|Browsershots|BLEXBot|woriobot|AMZNKAssocBot|Speedy|oBot|HostTracker|OpenWebSpider|WBSearchBot|FacebookExternalHit [NC,OR] 
       RewriteCond %{QUERY_STRING} _escaped_fragment_ 

       # Only proxy the request to Prerender if it's a request for HTML 
       RewriteRule ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent))(.*) http://service.prerender.io/http://vivule.ee/$2 [P,L] 
      </IfModule> 

      # Don't rewrite files or directories, but exclude adminer directory 
      RewriteRule ^(adminer)($|/) - [L] 
      RewriteCond %{REQUEST_FILENAME} -f 
      RewriteRule^- [L] 

      # Rewrite everything else to index.html to allow html5 state links 
      RewriteRule ^adminer - [L,NC] 
      RewriteRule^index.html [L] 

     </IfModule> 
-1

Dies könnte Ihre Homepage und dazu dient, den index.html aus der Zeit vor wird passend Die Prerender-Konfiguration wird ausgeführt

RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule^- [L] 

Versuchen Sie, die Prerender-Konfiguration in Ihrer Datei nach oben zu verschieben.

+0

Nö, das nicht helfen – yodalr