简体   繁体   中英

htaccess Issue : Header throwing 404 although page is correctly displayed

I am facing quite a strange problem at the moment, I have wordpress and oscommerce installations on single domain. I placed wordpress at the root and oscommerce in /store/ folder. Everything is working properly except one thing. The server headers of oscommerce are throwing a 404 error although the page is displayed correctly. This results in a situation that googlebot will not index these pages at all. Can anybody help me to resolve this issue? What should I do now?

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>

and oscommerce httaccess is

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>

( I know it´s two years later... but maybe it saves time for anybody )

I had the exact problem on an oscommerce shop. Just the product sites where showing like they should, but giving a header http 404 code .

So I looked into the product_info.php and there was something like this:

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

I was like: what the hell ! It actually had been placed there to actually improve SEO performance...

( That bad advise has been given here: http://forums.hostgator.com/oscommerce-enhancement-t27840.html )

What it actually can do is killing your SEO works...

( Cause when a product is sold out it will signal that it´s gone although it might be back later... )

This looks like an oscommerce misconfiguration. Other people have had similar issues. Try some of the solutions here or google for more examples.

The link won't work for some reason, sorry. Here is the cached page I was trying to link to 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM