Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

404 Error Page not always working

Asked Modified Viewed 3,266 times
W
wafflechunk
W
www.wafflechunks.com/../../images/badges/wafflebadge.png
  • Member, joined since
  • Contributed 60 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
asked
Member

I'm not quite sure if this is the right area to post this question, but here we go.

Before I came back to PHPFusion I gave Wordpress a try, now Google has a bunch of dead links stuck in it's search engine, such as:
http://www.wafflechunks.com/?p=659

The issue I'm having is that the link above will automatically redirect to my PHPFusion homepage instead of giving my 404 error page. I read on Google's Webmaster Tools help page, that if Google or other search engines doesn't get a 404 error, it will never remove the link from it's engine. Now this URL for instance will properly go to my 404 error page:
http://www.wafflechunks.com/blah.php

I'm guessing I need to do something in .htaccess, but I have no clue how to do anything in there.
0 replies

8 posts

J
Johan Wilson
J
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
answered
Junior Member

try this
<ifModule mod_rewrite.c>   
RewriteEngine On 
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.wafflechunks.com?p=([0-9]+)$
RewriteRule (.*) http://www.wafflechunks.com/$1 [R=301,L]
</ifModule>
Edited by Johan Wilson on 05-08-2009 09:25,
0 replies
W
wafflechunk
W
www.wafflechunks.com/../../images/badges/wafflebadge.png
  • Member, joined since
  • Contributed 60 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Member

Thanks for the attempt Barspin. The only difference that made was occiationally changing the displayed URL in the address bar to:
http://www.wafflechunks.com/?p=659
It still displayed my default PHPFusion page also, not a 404 Not Found page.

Is it possible to redirect this link to a page that doesn't exit?
0 replies
J
Johan Wilson
J
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
answered
Junior Member

oh i think i made a mistake do you see the $ in the end of line 4 try to remove that
0 replies
W
wafflechunk
W
www.wafflechunks.com/../../images/badges/wafflebadge.png
  • Member, joined since
  • Contributed 60 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Member

The rewrite you have there, is it supposed to do a 301(Moved Permanently) to my homepage URL? From what I can tell it's doing the same thing as before still. Is there a way to test to see if it's working right?
0 replies
J
Johan Wilson
J
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
answered
Junior Member

hmm i'm not sure but the 301 should update the google links, i quess you just have to wait and see
0 replies
W
wafflechunk
W
www.wafflechunks.com/../../images/badges/wafflebadge.png
  • Member, joined since
  • Contributed 60 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Member

Oh goodie! Gotta love the waiting game, lol. Thanks for your help Barspin. I'll try and update this thread later once I determine if this worked or not.
0 replies
W
wafflechunk
W
www.wafflechunks.com/../../images/badges/wafflebadge.png
  • Member, joined since
  • Contributed 60 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Member

Found a Firefox addon that can check for the redirect codes. With or without this .htaccess change, it's giving a 302 (temporary) redirect. Here's what the addon said when I try going to: http://www.wafflechunks.com/?p=659

Quote

http://www.wafflechunks.com/?p=659

GET /?p=659 HTTP/1.1
Host: www.wafflechunks.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: __utma=189649197.3916869091042326500.1248669183.1249513684.1249514428.18; __utmz=189649197.1248777300.7.2.utmcsr=kohguild.net|utmccn=(referral)|utmcmd=referral|utmcct=/news.php; fusion_visited=yes; __utmb=189649197.5.10.1249514428; __utmc=189649197

HTTP/1.x 302 Found
Date: Wed, 05 Aug 2009 23:26:10 GMT
Content-Type: text/html
Connection: keep-alive
Server: Apache
X-Powered-By: PHP/5.2.4
Content-Length: 0
Location: infusions/wrapper/wrapper.php?wrapper_id=1


0 replies
W
wafflechunk
W
www.wafflechunks.com/../../images/badges/wafflebadge.png
  • Member, joined since
  • Contributed 60 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Member

I think I figured out an alternate way to have Google and other search engines remove my old Wordpress links from it's index. The answer appears to lie within robots.txt. I just tell it to disallow everything Wordpress related, which should tell Googlebot and other bots to remove those items from their index.

robots.txt
User-agent: *
Disallow: /feed/
Disallow: /xmlrpc
Disallow: /?p=
Disallow: /wp-
Disallow: /tag/
Disallow: /category/
Disallow: /?tag=
Disallow: /?cat=
Disallow: /?paged=
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 8 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

W
W
www.wafflechunks.com/../../images/badges/wafflebadge.png
  • Member, joined since
  • Contributed 60 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
J
J
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet