为什么我的网站可以“加载”两次?

时间:2012-03-20 08:23:56

标签: php apache load-time pingdom

或者至少是pingdom所说的,我认为这是一项非常可靠的服务,

注意:

  1. APACHE:php& MySQL的
  2. 没有iframes
  3. htaccess的:

    #Gzip
    <ifmodule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x- javascript application/javascript
    </ifmodule>
    #End Gzip
    
    
    # 480 weeks
    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|css|swf)$">
    Header set Cache-Control "max-age=290304000, public"
    </FilesMatch>
    
    # 1 weeks
    <FilesMatch "\.(js)$">
    Header set Cache-Control "max-age=604800, public"
    </FilesMatch>
    
    RewriteEngine On
    
    
    ErrorDocument 500 /oohps.php
    ErrorDocument 404 /where.php
    
    
    RewriteCond %{HTTP_HOST} ^www.keepyourlinks.com [NC]
    RewriteRule ^(.*)$ http://keepyourlinks.com/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} ^www.keepyourlinks.byethost32.com [NC]
    RewriteRule ^(.*)$ http://keepyourlinks.com/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} ^keepyourlinks.byethost32.com [NC]
    RewriteRule ^(.*)$ http://keepyourlinks.com/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} ^keepyourlinks.com/pre/ [NC]
    RewriteRule ^(.*)$ http://keepyourlinks.com/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} ^piscolabis.info$
    RewriteCond %{REQUEST_URI} ^/keepyourlinks.com [NC]
    RewriteRule ^(.*)$ http://keepyourlinks.com/$1 [L,R=301]
    
    
    #Webs Sueltas
    
    RewriteRule ^facebook-likes$ fbmate.html
    RewriteRule ^api_webmasters$ API.php
    
    
    
    #Options +FollowSymLinks
    
    
    
    RewriteBase /
    
    RewriteRule ^keep/(.+)/(.+) link1.php?id=$1
    RewriteRule ^article/(.+)/(.+) ?tipo=questions&que=view&id=$1
    RewriteRule ^file/(.+)/(.+) ?tipo=files&que=view&id=$1
    RewriteRule ^user/(.+)/(.+) ?que=usuario&id=$1
    
    RewriteRule ^categories/(.+)/(.+) listarenlaces.php?id=$1
    
  4. 我只是在寻找可能的原因

4 个答案:

答案 0 :(得分:6)

与.htaccess

无关

仔细阅读您的网站代码。你在“最后活动”部分中已经有了这一点:

<img src="http://keepyourlinks.com/" width="30" height="30"/>

...您将在图片代码中重新加载整个页面。

更多背景信息,以帮助您找到生成位置:

<div class="comentario">
    <a href="http://keepyourlinks.com/user/736/laroma">
        <img src="http://keepyourlinks.com/" width="30" height="30"/> laroma
    </a>
    <span class="suave"> ha comentado </span>
    <a href="http://keepyourlinks.com/keep/186577/deshidratacion">deshidratacion</a>
    <span class="fecha"> 72 dias:</span>
    <p>
        La deshidratación es la pérdida excesiva de agua respecto al agua que se ingiere. El European Hydration Institute (EHI) es una fundación creada con el fin de avanzar y profundizar en el conocimiento acerca de la hidratación humana y sus efectos sobre la salud, el bienestar y el rendimiento físico y cognitivo.
    </p>
</div>

答案 1 :(得分:3)

这是旧的,但我遇到了类似的问题。问题在于div的课程中的css。我有一个background:url();作为占位符(打算稍后提供图像)但忘了它。

使用空白背景网址时,FF19会出现两次加载页面问题。我注意到使用LiveHTTPheaders的问题。 Haven未经其他浏览器/版本测试。删除它可以解决问题。添加它可以重复地重新引入问题。

答案 2 :(得分:1)

只想与同样的问题分享我的情况。

我忘记了一行代码,它为背景图像创建了带内联样式的div元素,并使用了未定义的变量:

style="background-image: url( <?php echo $image_url ?>)"

将此打印的错误消息转换为样式而不是url,并且该元素第二次加载了我的页面,因此视图计数器每次增加2。在修复其他东西时意外发现它。

答案 3 :(得分:0)

就我而言,每次访问“ /index.php”和“ /”时,它们只会加载两次。

发生这种情况是因为我在“ / etc / apache2 / sites-available /”的虚拟主机配置文件(apache)中包含以下行:

<VirtualHost XXX.localhost:80>
    FallbackResource /index.php
</VirtualHost>

删除“ FallbackResource”行后,一切正常。 我上面提到的链接/页面不再重复加载。