Thread: no 404 page

Results 1 to 6 of 6
  1. #1
    Join Date
    May 2009
    Posts
    36
    Plugin Contributions
    0

    Default no 404 page

    Ok if I type in my address http://police-equipment-worldwide.com/fubar it takes me to the home page instead of a 404 error page, but if I type in http://police-equipment-worldwide.co...ain_page=fubar it will go to the 404 page correctly. This is really hurting me on search rankings. Im sure it has something to do with my htaccess but I just cant figure it out, any suggestions?

    Here is my .htaccess...

    Code:
    #### BOF SSU
    Options +FollowSymLinks -MultiViews
    RewriteEngine on
    # Make sure to change "zencart" to the subfolder you install ZC. If you use root folder, change to: RewriteBase /
    RewriteBase /
    Options -Indexes
    
    
    
    # Start the Apache RewriteEngine.
    
    RewriteEngine on
    
    
    
    RewriteCond %{HTTP_USER_AGENT} ^Morfeus
    
    RewriteRule ^.*$ - [F]
    
    
    
    # Add www.
    
    RewriteCond %{HTTP_HOST} ^police-equipment-worldwide.com [NC]
    
    RewriteRule .? http://www.police-equipment-worldwide.com%{REQUEST_URI} [R=301,L]
    
    
    
    # CycleCop.com
    
    RewriteCond %{HTTP_HOST} ^cyclecop\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.cyclecop\.com [NC]
    
    RewriteRule ^CycleCop(.*) - [L]
    
    RewriteCond %{HTTP_HOST} ^cyclecop\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.cyclecop\.com [NC]
    
    RewriteRule ^(.*) CycleCop/$1 [L]
    
    
    
    # TeksPolice.com
    
    RewriteCond %{HTTP_HOST} ^tekspolice\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.tekspolice\.com [NC]
    
    RewriteRule ^TeksPolice - [L]
    
    RewriteCond %{HTTP_HOST} ^tekspolice\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.tekspolice\.com [NC]
    
    RewriteRule ^(.*) TeksPolice/$1 [L]
    
    
    
    # Police-Motorcycle-Equipment.com
    
    RewriteCond %{HTTP_HOST} ^police-motorcycle-equipment\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.police-motorcycle-equipment\.com [NC]
    
    RewriteRule ^Police-Motorcycle-Equipment - [L]
    
    RewriteCond %{HTTP_HOST} ^police-motorcycle-equipment\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.police-motorcycle-equipment\.com [NC]
    
    RewriteRule ^(.*) Police-Motorcycle-Equipment/$1 [L]
    
    
    
    
    
    # Police-Motorcycle-Equipment.com
    
    RewriteCond %{HTTP_HOST} ^police-motorcycle-equipment.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www.police-motorcycle-equipment.com [NC]
    
    RewriteRule !^(Police-Motorcycle-Equipment.com)$ Police-Motorcycle-Equipment.com/$1 [L]
    
    
    
    # Remove charactors from url's
    
    RewriteRule ^/?(.*)'(.*)$ $1$2 [R=301,N,L]
    
    
    
    
    
    
    
    
    
    
    
    RewriteRule ^favicon.ico - [L]
    
    RewriteRule ^robots.txt - [L]
    
    #RewriteRule ^info.txt - [L]
    
    RewriteRule ^misc/(.*) - [L]
    
    RewriteRule ^CSS/(.*) - [L]
    
    RewriteRule ^images/(.*) - [L]
    RewriteRule ^zc_install/(.*) - [L]
    
    RewriteRule ^Scripts/(.*) - [L]
    RewriteRule ^extras/(.*) - [L]
    RewriteRule ^PDF/(.*) - [L]
    
    RewriteRule ^Public/(.*) - [L]
    
    RewriteRule ^PV/(.*) - [L]
    
    RewriteRule ^includes/(.*) - [L]
    RewriteRule ^zen/(.*) - [L]
    
    RewriteRule ^old/(.*) - [L]
    
    RewriteRule ^info/(.*) - [L]
    
    RewriteRule ^Store/(.*) - [L]
    
    RewriteRule ^admin/(.*) - [L]
    
    RewriteRule ^MODPDF/(.*)  PDF/View.php [L]
    
    RewriteRule ^(.*) index.php [L]
    
    
    # Deny access from .htaccess
    RewriteRule ^\.htaccess$ - [F]

  2. #2
    Join Date
    Jan 2004
    Posts
    66,447
    Plugin Contributions
    81

    Default Re: no 404 page

    If you look in your /extras folder, you'll see an example of the .htaccess code you need to copy and add to your main .htaccess to handle 404 page redirects to where you want them to go.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2009
    Posts
    36
    Plugin Contributions
    0

    Default Re: no 404 page

    DrByte: thanks for the reply but this is not working for my site, I changed it to look like

    Code:
    #### BOF SSU
    
    
    ErrorDocument 404 http://www.police-equipment-worldwide.com/index.php?main_page=page_not_found
    Options +FollowSymLinks -MultiViews
    RewriteEngine on
    # Make sure to change "zencart" to the subfolder you install ZC. If you use root folder, change to: RewriteBase /
    RewriteBase /
    Options -Indexes
    
    
    
    # Start the Apache RewriteEngine.
    
    RewriteEngine on
    
    
    
    RewriteCond %{HTTP_USER_AGENT} ^Morfeus
    
    RewriteRule ^.*$ - [F]
    
    
    
    # Add www.
    
    RewriteCond %{HTTP_HOST} ^police-equipment-worldwide.com [NC]
    
    RewriteRule .? http://www.police-equipment-worldwide.com%{REQUEST_URI} [R=301,L]
    
    
    
    # CycleCop.com
    
    RewriteCond %{HTTP_HOST} ^cyclecop\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.cyclecop\.com [NC]
    
    RewriteRule ^CycleCop(.*) - [L]
    
    RewriteCond %{HTTP_HOST} ^cyclecop\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.cyclecop\.com [NC]
    
    RewriteRule ^(.*) CycleCop/$1 [L]
    
    
    
    # TeksPolice.com
    
    RewriteCond %{HTTP_HOST} ^tekspolice\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.tekspolice\.com [NC]
    
    RewriteRule ^TeksPolice - [L]
    
    RewriteCond %{HTTP_HOST} ^tekspolice\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.tekspolice\.com [NC]
    
    RewriteRule ^(.*) TeksPolice/$1 [L]
    
    
    
    # Police-Motorcycle-Equipment.com
    
    RewriteCond %{HTTP_HOST} ^police-motorcycle-equipment\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.police-motorcycle-equipment\.com [NC]
    
    RewriteRule ^Police-Motorcycle-Equipment - [L]
    
    RewriteCond %{HTTP_HOST} ^police-motorcycle-equipment\.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www\.police-motorcycle-equipment\.com [NC]
    
    RewriteRule ^(.*) Police-Motorcycle-Equipment/$1 [L]
    
    
    
    
    
    # Police-Motorcycle-Equipment.com
    
    RewriteCond %{HTTP_HOST} ^police-motorcycle-equipment.com [NC,OR]
    
    RewriteCond %{HTTP_HOST} ^www.police-motorcycle-equipment.com [NC]
    
    RewriteRule !^(Police-Motorcycle-Equipment.com)$ Police-Motorcycle-Equipment.com/$1 [L]
    
    
    
    # Remove charactors from url's
    
    RewriteRule ^/?(.*)'(.*)$ $1$2 [R=301,N,L]
    
    
    
    
    
    
    
    
    
    RewriteRule ^favicon.ico - [L]
    
    RewriteRule ^robots.txt - [L]
    
    #RewriteRule ^info.txt - [L]
    
    RewriteRule ^misc/(.*) - [L]
    
    RewriteRule ^CSS/(.*) - [L]
    
    RewriteRule ^images/(.*) - [L]
    RewriteRule ^zc_install/(.*) - [L]
    
    RewriteRule ^Scripts/(.*) - [L]
    RewriteRule ^extras/(.*) - [L]
    RewriteRule ^PDF/(.*) - [L]
    
    RewriteRule ^Public/(.*) - [L]
    
    RewriteRule ^PV/(.*) - [L]
    
    RewriteRule ^includes/(.*) - [L]
    RewriteRule ^zen/(.*) - [L]
    
    RewriteRule ^old/(.*) - [L]
    
    RewriteRule ^info/(.*) - [L]
    
    RewriteRule ^Store/(.*) - [L]
    
    RewriteRule ^admin/(.*) - [L]
    
    RewriteRule ^MODPDF/(.*)  PDF/View.php [L]
    
    RewriteRule ^(.*) index.php [L]
    
    
    # Deny access from .htaccess
    RewriteRule ^\.htaccess$ - [F]
    I also tried putting the errordocument after rewrite rule turning on, neither worked. Any suggestions? Is there something in my .htaccess preventing this from working?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,447
    Plugin Contributions
    81

    Default Re: no 404 page

    I'm completely ignoring all your RewriteRule lines, because they should have no impact on an ErrorDocument directive.

    If the .htaccess file you quoted is in the top of your webroot (ie: .../public_html/.htaccess), then it should work just fine.
    Apparently it doesn't ... so ... you'll need to talk to your hosting company about how *they* have configured the server with respect to ErrorDocument directives. Maybe they require that you set those up using your hosting account control panel? Or maybe they don't allow you to override them at all. Or maybe they have a master rule which is prevailing.
    Whatever the case, you need someone familiar with your particular server's technical configuration to look at it.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    May 2009
    Posts
    36
    Plugin Contributions
    0

    Default Re: no 404 page

    ok I figured it out on my own, the htaccess was from a clients previous store and I am not quite sure why they had the line
    Code:
    RewriteRule ^(.*) index.php [L]
    since by default the website goes to index.php when you type in the address and all links should point to the right spot, unless their php required it for some reason. So far removing that line has allowed the 404 error to work correctly, and I havent seen any problems yet. Still testing areas of the site, but I dont see any problems popping up. Thank you again

    (took me a minute to remember all the stuff that works with rewrite engine, and this line of course forwards anything not specifically stated to be routed to route to the index.php, hence why 404's were showing the index page.)

  6. #6
    Join Date
    Jan 2004
    Posts
    66,447
    Plugin Contributions
    81

    Default Re: no 404 page

    Ah. See, that's why I stay away from RewriteRules.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Login page gives error 404 page not found
    By g28469b in forum General Questions
    Replies: 13
    Last Post: 20 Apr 2011, 11:23 PM
  2. Page Not Found Custom 404 Error Page with Site Map Sample Text
    By derek53 in forum Basic Configuration
    Replies: 5
    Last Post: 25 May 2010, 10:16 AM
  3. 404 Page Not Found on Custom PHP Developed Page
    By mariasims in forum General Questions
    Replies: 1
    Last Post: 13 May 2010, 09:27 AM
  4. Page Not Found - Custom 404 Error Page
    By Zoramilea in forum General Questions
    Replies: 4
    Last Post: 15 Sep 2008, 11:39 PM
  5. 404 on my zencart page
    By Renai in forum General Questions
    Replies: 4
    Last Post: 5 Dec 2006, 05:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg