【问题标题】:htaccess Issue : Header throwing 404 although page is correctly displayedhtaccess 问题:尽管页面正确显示,但标题抛出 404
【发布时间】:2012-02-15 08:52:19
【问题描述】:

目前我面临一个非常奇怪的问题,我在单个域上安装了 wordpress 和 oscommerce。我将 wordpress 放在根目录中,并将 oscommerce 放在 /store/ 文件夹中。 除了一件事,一切都正常工作。尽管页面显示正确,但 oscommerce 的服务器标头会引发 404 错误。这会导致 googlebot 根本不会索引这些页面。 有人可以帮我解决这个问题吗?我现在该怎么办?

Root httaccess is 

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

RewriteEngine On
RewriteCond %{HTTP_HOST} ^outdoorwatersolutions.com [NC]
RewriteRule ^(.*)$ http://www.outdoorwatersolutions.com/$1 [L,R=301]


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

而 oscommerce httaccess 是

Options +SymLinksIfOwnerMatch
<IfModule mod_rewrite.c>
 RewriteEngine On

 # RewriteBase instructions
 # Change RewriteBase dependent on how your shop is accessed as below.
 # http://www.mysite.com = RewriteBase /
 # http://www.mysite.com/catalog/ = RewriteBase /catalog/
 # http://www.mysite.com/catalog/shop/ = RewriteBase /catalog/shop/

 # Change RewriteBase using the instructions above 
 RewriteBase /store/
 RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ popup_image.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ product_reviews.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,L,QSA]
 # Articles contribution
 RewriteRule ^([a-z0-9/-]+)-t-([0-9_]+).html$ articles.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-au-([0-9]+).html$ articles.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-a-([0-9]+).html$ article_info.php [NC,L,QSA]
 # Information pages
 RewriteRule ^([a-z0-9/-]+)-i-([0-9]+).html$ information.php [NC,L,QSA]
 # Links contribution
 RewriteRule ^([a-z0-9/-]+)-links-([0-9_]+).html$ links.php [NC,L,QSA]
 # Newsdesk contribution
 RewriteRule ^([a-z0-9/-]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA]
</IfModule>

【问题讨论】:

  • 我认为除非您显示您的 .htaccess 文件或 httpd.conf(无论哪个是问题),否则您不会得到太多帮助。
  • 您可以尝试 serverfault.com 以获取配置 Web 服务器的帮助。
  • 我认为这不是 .htaccess 问题。您确定代码由于某种原因没有打印出 404 标头吗?
  • 那么它可能是什么?页面显示正常,但是oscommerce访问server header,遇到404错误,那你说什么?
  • 根据我的谷歌搜索,oscommerce 中的搜索引擎安全网址会导致此问题。

标签: php apache .htaccess googlebot


【解决方案1】:

这看起来像是 oscommerce 配置错误。其他人也有类似的问题。尝试一些解决方案here 或谷歌获取更多示例。

链接由于某种原因无法使用,抱歉。这是我试图链接到http://webcache.googleusercontent.com/search?q=cache:Z2i_KItzGHcJ:www.oscmax.com/forums/oscommerce-2-2-installation-help/3962-getting-404-error-when-trying-view-products.html+&cd=9&hl=en&ct=clnk&gl=us&client=firefox-a的缓存页面

【讨论】:

    【解决方案2】:

    (我知道两年后...但也许它可以为任何人节省时间)

    我在 oscommerce 商店遇到了确切的问题。 只是显示应该显示的产品网站, 但给出一个header http 404 代码

    所以我查看了 product_info.php 有这样的事情:

    if ($product_check['total'] < 1) header('HTTP/1.1 404 Not Found');
    

    我当时想:什么鬼! 它实际上已被放置在那里以实际提高 SEO 性能...

    (这里给出了这个糟糕的建议: http://forums.hostgator.com/oscommerce-enhancement-t27840.html )

    它实际上可以做的是扼杀你的 SEO 工作......

    (因为当产品售罄时,它会发出已售罄的信号 虽然它可能稍后会回来......)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-16
      • 2020-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-05
      • 2011-06-22
      相关资源
      最近更新 更多