Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Page 1 of 2 12 LastLast
Results 1 to 15 of 25

This is a discussion on Wordpress Hijacks 404 in the Shared & Semi-Dedicated forum
I tried to ask this over on the WordPress Support site, but no one has gotten back to it in forever. I was going to ...

  1. #1
    coin operated boy Rye Seronie Oh's Avatar
    Join Date
    Mar 2005
    Location
    Crosby, TX
    Posts
    125

    Wordpress Hijacks 404

    I tried to ask this over on the WordPress Support site, but no one has gotten back to it in forever. I was going to search the site, but their search wasn't working so I just posted again. Anyhow, what's happening is this:

    I have the Permalinks making friendly URLs and it's causing it to take over my everything. I want to have a custom 404 that is not the WP 404 page. The main problem is that when someone gets a 404, it redirects then to index.php and that causes my stats to be showing a ton of hits that are really just 404s.

    I tried adding "ErrorDocument 404 whatever.html" and nothing happens. It continues to go to index.php on a 404. Or any other site error for that matter. My htaccess file says this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Perhaps someone can help me take back my 404 page control?
    Ryan Ottele
    Web: http://www.sparkeh.com/
    Mail: ryan.ottele[[@]]gmail.com

  2. #2
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    Does that WP 404 page actually send a 404 header, or does it give your browser the "normal" 200 instead?

    Indeed you reroute all through WP now (so putting up an extra 404 page won't help), but I would hope the stats can handle it anyway as long as WP throws proper 404 headers.

    If it's the site in your signature: that doesn't seem to throw 404s at all or give me any indication when a URL doens't exist. It just feeds me the home page like all is fine. If they won't fix that, I'm afraid you need to dig into WordPress yourself, and tell it to throw a 404 when appropriate.
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  3. #3
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I would try...

    Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    ErrorDocument 400 http://www.example.com/errordocs/400.php
    ErrorDocument 401 http://www.example.com/errordocs/401.php
    ErrorDocument 403 http://www.example.com/errordocs/403.php
    ErrorDocument 404 http://www.example.com/errordocs/404.php
    ErrorDocument 405 http://www.example.com/errordocs/405.php
    ErrorDocument 406 http://www.example.com/errordocs/406.php
    ErrorDocument 408 http://www.example.com/errordocs/408.php
    ErrorDocument 410 http://www.example.com/errordocs/410.php
    ErrorDocument 411 http://www.example.com/errordocs/411.php
    ErrorDocument 414 http://www.example.com/errordocs/414.php
    ErrorDocument 500 http://www.example.com/errordocs/500.php
    ErrorDocument 503 http://www.example.com/errordocs/503.php
    # END WordPress
    ...or not! (Been hangin' around Ron too long)
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Heh!

    BTW, this might give you some ideas on making suitable errordoc files...

    http://www.plinko.net/404/default.asp
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  5. #5
    coin operated boy Rye Seronie Oh's Avatar
    Join Date
    Mar 2005
    Location
    Crosby, TX
    Posts
    125
    Okay, I made http://www.sparkeh.com/404.php and set it up in htaccess with the ErrorDocument thing. I had tried that to no avail, and it still doesn't work.

    I put a 404 in my template folder ~/public_html/blog/wp-themes/theme/404.php and it shows up now as the 404. I dunno if it returns the 404 error code or 200.

    I use TrackPro 2 as my stats. It records all hits to just index.php and with all the 404s going onto index.php, that makes it useless to have the stats. That's the big issue. I just want to count hits to the index.php that aren't related to 404.

    Wordpress' automated permalink system has changed. It use to show every single link that it made, but now it seems to just make anything go to wordpress and that is annoying. I don't know enough about htaccess to recreate it the way it used to be really. I could manually do it, but the categories and archives wouldn't work right.

    I posted on the WP forums and there still is no reply so I guess no one there knows or hasn't seen it.

    Any ideas now?

    Edit: According to this http://validator.w3.org/check?uri=ht...m%2 Fnotfound it seems as if a wrong URL does return a 404 error even if it is showing the wordpress 404.

    I just want my own 404 so that i can use TrackPro correctly.
    Last edited by Rye Seronie Oh; 03-26-2006 at 08:15 PM.
    Ryan Ottele
    Web: http://www.sparkeh.com/
    Mail: ryan.ottele[[@]]gmail.com

  6. #6
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    This is why I like 'answering' questions... it gives me ideas too!

    Here's a custom 404 page, done right!

    http://www.apple.com/nothere.htm

    • Allow people to go somewhere other than back.
    • Include a link to email the webmaster or a form to submit broken links.
    • Include a search box to search the site.
    • List the links on the site that are similar to what was entered, in order to guess what they were looking for.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  7. #7
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Quote Originally Posted by Rye Seronie Oh
    Okay, I made http://www.sparkeh.com/404.php and set it up in htaccess with the ErrorDocument thing. I had tried that to no avail, and it still doesn't work...
    Aha! How about something like this?

    Code:
    ErrorDocument 404 http://www.example.com/errordocs/404/index.php
    I'm flying blind here...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  8. #8
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I suppose I could go try it on my own WP install, huh?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  9. #9
    coin operated boy Rye Seronie Oh's Avatar
    Join Date
    Mar 2005
    Location
    Crosby, TX
    Posts
    125
    Nothing is working. Wordpress is taking over everything. Is there a way to make that htaccess have an exception for files that are found or something? That appears to be what I need.
    Ryan Ottele
    Web: http://www.sparkeh.com/
    Mail: ryan.ottele[[@]]gmail.com

  10. #10
    coin operated boy Rye Seronie Oh's Avatar
    Join Date
    Mar 2005
    Location
    Crosby, TX
    Posts
    125
    Quote Originally Posted by Vin DSL
    I suppose I could go try it on my own WP install, huh?
    Perhaps you could post your htaccess for wordpress? That might be the old style that I can use...
    Ryan Ottele
    Web: http://www.sparkeh.com/
    Mail: ryan.ottele[[@]]gmail.com

  11. #11
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    LoL! Hold on... I'm getting there...

    Good URL: http://lenon.info/index.php (response header 200)

    Bad URL: http://lenon.info/foo.php (response header 404)

    Um... I'm hungry... gotta eat some 'breakfast'... BRB...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  12. #12
    coin operated boy Rye Seronie Oh's Avatar
    Join Date
    Mar 2005
    Location
    Crosby, TX
    Posts
    125
    Haha.. I just saw checked that out and it appears that your "foo.php" sends you into the Wordpress 404 file just as mine does. I guess, with the way wordpress has changed their permalink htaccess code, my only true resolution is going to be to move the blog into /blog and not run it out of the root. I didn't wanna have to do that but it's starting to look like there isn't another resolution..
    Ryan Ottele
    Web: http://www.sparkeh.com/
    Mail: ryan.ottele[[@]]gmail.com

  13. #13
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Well, You're basically watching me work, while eating breakfast, so you can expect a *belch* here n' there.

    Um... I'm not sure what you're referring to. When I click the 'foo.php' link (now), it takes me to the search feature on my blog... Is that what you're talking about?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  14. #14
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    These two lines:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    are filtering anythink that is not a file (!-f) and not a directory (!-d) into WordPress, so the ErrorDocument code is never firing.

    You could always go back to the old style rewites:

    Code:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^log/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^log/category/?(.*) /index.php?category_name=$1 [QSA]
    RewriteRule ^log/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?author_name=$1&feed=$2 [QSA]
    RewriteRule ^log/author/?(.*) /index.php?author_name=$1 [QSA]
    RewriteRule ^log/([0-9]+)?([0-9]+)?/?$ /index.php?p=$1&page=$2 [QSA]
    RewriteRule ^log/([0-9]+)?/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?p=$1&feed=$2 [QSA]
    RewriteRule ^log/([0-9]+)?/trackback/?$ /wp-trackback.php?p=$1 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1&withcomments=1 [QSA]
    Some of the directives may have changed a little since that file was created (I grabbed it from an old backup), but that should get you started.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  15. #15
    coin operated boy Rye Seronie Oh's Avatar
    Join Date
    Mar 2005
    Location
    Crosby, TX
    Posts
    125
    Excellent, Jason. I wonder why Wordpress has switched to that? You'd think they'd be a little more careful than to just snatch up every single file on the site. I guess it's great to support their 404 thing, but it really messes up my stats.

    Thanks for the explanation. I knew it had to be in those two lines but wasn't sure how it worked.
    Ryan Ottele
    Web: http://www.sparkeh.com/
    Mail: ryan.ottele[[@]]gmail.com

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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