Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error pager 404 make me crazy :)


addeaz

Recommended Posts

Hi,

If I implement any kind of errorpage for not found pages, 404 (tryed some different addons), many of the customer on our site is landing on this url

 

http://www.mywebpage.com/images/line_.gif

 

Even if I only do this small adjustment in .htaccess

ErrorDocument 404 /index.php

 

The same thing is happen, the customer is often landing on this page;

 

http://www.mywebpage.com/images/line_.gif

 

I monitor the visitors on whos_online.php in the admin panel, then I noticed that they came into that adress directly after that change. I tryed myself to come to that adress when surfing on our webpage, but I dont find any link like that myself, so it works for me.

 

When I take back that 404 error page redirection, everything works fine again.

 

I do not have any clue how this is possible, do anyone of you?

 

Best Regards

Andreas

Link to comment
Share on other sites

Very strange. OK, what is /index.php? Is your store installed into the root rather than /catalog? Is the ErrorDocument statement up near the top of /.htaccess, before any SEO/SEF for osC, or is it after? Have you scanned your PHP files and your .htaccess file(s) for line_.gif? I don't think that's a part of standard osC. You're getting different behaviors for changes to .htaccess, so it sounds like you're on an Apache server (which accepts .htaccess) rather than IIS. Can you show the entire /.htaccess file and any other .htaccess files below that one?

 

One thing you could try is sending 404's to /404.shtml. Just print out a message that the file wasn't found. If that works (I don't know why /index.php wouldn't), you could try redirecting (meta refresh tag) to /index.php after 5 or 10 seconds.

Link to comment
Share on other sites

Very strange. OK, what is /index.php? Is your store installed into the root rather than /catalog? Is the ErrorDocument statement up near the top of /.htaccess, before any SEO/SEF for osC, or is it after? Have you scanned your PHP files and your .htaccess file(s) for line_.gif? I don't think that's a part of standard osC. You're getting different behaviors for changes to .htaccess, so it sounds like you're on an Apache server (which accepts .htaccess) rather than IIS. Can you show the entire /.htaccess file and any other .htaccess files below that one?

 

One thing you could try is sending 404's to /404.shtml. Just print out a message that the file wasn't found. If that works (I don't know why /index.php wouldn't), you could try redirecting (meta refresh tag) to /index.php after 5 or 10 seconds.

 

Hi MrPhil,

Thank you for your reply, I have been in Denmark on vacation a couple of days, now Im back in business :).

 

My store is installed in the root and not in catalog and I'm in a Apache server.

 

When I scan my site the only .php that contain the line_.gif is boxes.php (within catalog classes), below is the code that is exist in:

 

function tep_draw_result2_bottom()
{
  return $table = '<div style="background:url(images/line_.gif) 0px 0px repeat-x;padding:0px 0px 0px 0px;">'.tep_draw_separator('spacer.gif', '1', '1').'</div>';
 }

 

When I erased that entire code it seems that whos_online in admin panel is showing correct, you think that it is ok to erase that code or may it be used in some other way? My site seems to work without it.

 

 

When I before customed a 404 site, the whos_online in the admin panel shows that med or my customers is landing on the custom 404 error site /http_error.php?error_id=404, but now when I erased that code even this seems to work!

 

 

Below is my code when in .htaccess now with a custom 404 site:

 

ErrorDocument 404 http://www.stylingagenten.se/http_error.php?error_id=404
# $Id: .htaccess 1739 2007-12-20 00:52:16Z hpdl $
#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
#   AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)
# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers
#<IfModule mod_setenvif.c>
#  <IfDefine SSL>
#    SetEnvIf User-Agent ".*MSIE.*" \
#			 nokeepalive ssl-unclean-shutdown \
#			 downgrade-1.0 force-response-1.0
#  </IfDefine>
#</IfModule>
# If Search Engine Friendly URLs do not work, try enabling the
# following Apache configuration parameter

### add this to your site root htaccess
AddHandler application/x-httpd-php .css .js

### Use this instead (below) if needed - PHP5 as default
###AddHandler application/x-httpd-php5 .css .js

### end of htaccess edit

# BEGIN Expire headers

ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType text/html "access plus 2592000 seconds"

# END Expire headers



# AcceptPathInfo On
# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)
# php_value session.use_trans_sid 0
# php_value register_globals 1
# Ultimate SEO URLs BEGIN
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^options\=(.*)$
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2%1
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-au-(.*).html$ articles.php?authors_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}
# BOF: "Extra pages-info box w/ admin" support added by faaliyet
RewriteRule ^(.*)-pm-([0-9]+).html$ info_pages.php?pages_id=$2&%{QUERY_STRING}
# EOF: "Extra pages-info box w/ admin" support added by faaliyet
RewriteRule ^(.*)-links-(.*).html$ links.php?lPath=$2&%{QUERY_STRING}
# Added polls and newsdesk
#RewriteRule ^(.*)-po-([0-9]+).html$ pollbooth.php?pollid=$2&%{QUERY_STRING}
 RewriteRule ^(.*)-n-(.*).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING}
 RewriteRule ^(.*)-nc-(.*).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING}
 RewriteRule ^(.*)-nri-(.*).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING}
 RewriteRule ^(.*)-nra-(.*).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING}
# BOF: Faqdesk support added by faaliyet
 RewriteRule ^(.*)-f-(.*).html$ faqdesk_info.php?faqdesk_id=$2&%{QUERY_STRING}
 RewriteRule ^(.*)-fc-(.*).html$ faqdesk_index.php?faqPath=$2&%{QUERY_STRING}
 RewriteRule ^(.*)-fri-(.*).html$ faqdesk_reviews_info.php?faqdesk_id=$2&%{QUERY_STRING}
 RewriteRule ^(.*)-fra-(.*).html$ faqdesk_reviews_article.php?faqdesk_id=$2&%{QUERY_STRING}
# EOF: Faqdesk support added by faaliyet
# Ultimate SEO URLs END
# Block Bad Bots
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:[email protected] [OR]
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]
RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]
RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]
RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]
RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]
RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]
RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]
RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]
RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR]
RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]
RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR]
RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]
RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR]
RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR]
RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR]
RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR]
RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]
RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR]
RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]
RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]
RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR]
RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]
RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR]
RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule .* - [F]

## MediaAnalys
# 301 'utan www' till www
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.stylingagenten.se/ [R=301,L]
order allow,deny
deny from h143n1.blg-stadsnat.ias.bredband.telia.com
deny from spider-77-88-27-26.yandex.com
deny from 38.101.148.126
allow from all

 

Thank you so much for your help!! Your guidelines hopefully made it work now (w00t)

Link to comment
Share on other sites

This is very confusing. Are you saying that it works now (after changes), or do you still have problems?

 

In your ErrorDocument statement, unless this is on a different domain, try omitting the http://www.stylingagenten.se and just use

ErrorDocument 404 /http_error.php?error_id=404

I have heard of problems using .php scripts as Error Documents on some hosts -- you may want to Google htaccess errordocument and read about workarounds.

 

What is this:

AddHandler application/x-httpd-php .css .js

? Do you really need to send CSS and Javascript through your PHP processor? Have you added <?php...?> code segments?

 

function tep_draw_result2_bottom() 

That's not standard osCommerce. Where did it come from? An add-on? I can't imagine why visitors would be sent to that "page" which is just a background image for something. Does 'images/line_.gif' exist? Remember that it's relative to whatever directory this PHP code is executing in. It's possible that the directory is wrong in some cases (if so, you might want to change it to an absolute path).

 

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.stylingagenten.se/ [R=301,L] 

What are you trying to accomplish here? You have an HTTP request such as GET /index.php HTTP/.... and you change it to another (same?) domain?

Link to comment
Share on other sites

This is very confusing. Are you saying that it works now (after changes), or do you still have problems?

It's work now when I did that change, I don't know why...but I'm glad it does!

 

In your ErrorDocument statement, unless this is on a different domain, try omitting the http://www.stylingagenten.se and just use

ErrorDocument 404 /http_error.php?error_id=404

I have heard of problems using .php scripts as Error Documents on some hosts -- you may want to Google htaccess errordocument and read about workarounds.

 

What is this:

AddHandler application/x-httpd-php .css .js

? Do you really need to send CSS and Javascript through your PHP processor? Have you added <?php...?> code segments?

This is from a compression addon I integrated years ago, yes it exist <?php...?> in code segment. I don't know if it really do my site faster though:)

 

 

function tep_draw_result2_bottom() 

That's not standard osCommerce. Where did it come from? An add-on? I can't imagine why visitors would be sent to that "page" which is just a background image for something. Does 'images/line_.gif' exist? Remember that it's relative to whatever directory this PHP code is executing in. It's possible that the directory is wrong in some cases (if so, you might want to change it to an absolute path).

 

I think this is from the original template (bought from monster), I have no imagefile "line_.gif" so quite strange that the code exist.

 

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.stylingagenten.se/ [R=301,L] 

What are you trying to accomplish here? You have an HTTP request such as GET /index.php HTTP/.... and you change it to another (same?) domain?

 

The company that help us with our SEO added that to code, probably to get extra powered link directly to http://www.stylingagenten.se/, and therefore redirect (301) index.php. Is your experience that it is positive for Google?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...