Welcome to WebmasterWorld Guest from 54.226.58.177

Forum Moderators: Robert Charlton & goodroi

301ing non-existent/ misspelled urls to the home page?

     
1:40 am on Jan 9, 2019 (gmt 0)

New User

joined:Jan 8, 2019
posts:15
votes: 0


The site I recently took over redirects ANY non-existent url to the home page.

So if a user mispells the actual url it will redirect to homepage.

Someone told me this is bad, but didn't explain why.

I've researched but only found that it's bad to redirect to the homepage from URLs that actually existed before (because the relevancy of the home page isn't the same as the old content).

Any thoughts?
2:06 am on Jan 9, 2019 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:11529
votes: 179


from Official Google Webmaster Central Blog: Do 404s hurt my site? [webmasters.googleblog.com]:
A soft 404 is when a web server returns a response code other than 404 (or 410) for a URL that doesn’t exist.
...
Another example is when a site redirects any unknown URLs to their homepage instead of returning 404s. Both of these cases can have negative effects on our understanding and indexing of your site, so we recommend making sure your server returns the proper response codes for nonexistent content.
2:28 pm on Jan 9, 2019 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Sept 7, 2006
posts: 1047
votes: 99


Phranque points out one major disadvantage: if a user or search-engine tries to connect to a non-existent URL the correct server response is 404. 301 is a message that the page has permanently moved, which isn't correct.

Furthermore, if the missing page is one you have removed, a 301 tells search-engines and everyone else that the page has moved to your Home page URL, which is not just a different URL, but also completely different content. This, as your own research had already discovered, is not good. Worse, if the wrong address is a typo in some third-party's link - this happens, and is out of your control - search engines will follow the link, with the same result.

However, another problem is that it provides a frustrating user experience if, for example, a mistyped internal link keeps sending them to your Home page, when they expect to be soemwhere else.

The best way to deal with this is to create an error page (one that tells the user the URL they have entered doesn't exist, preferably also providing possible reasons and suggesting solutions), and ensure the non-existent URL returns a 404.

How you do this depends on how it is being done already, but on an apache server you can use .htaccess to create a rule and define the response code. If you don't have that control (If, for example, it is being handled through a CMS, or by ticking a box in your hosting provider's configuration settings), you can get round it by redirecting to your error page and using PHP to handle the response code there.
9:13 pm on Jan 9, 2019 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15381
votes: 727


it provides a frustrating user experience
All the upvotes. Please remember your users. It's no use coming out #1 on every search in the world if people hate your site. (Worst of all is when some page that comes up in a SERP has subsequently been removed, so you end up on the front page with no idea how you got there.)

you can use .htaccess to create a rule and define the response code
In the situation described here, it's even easier, because all you need to do is remove the current rule creating the redirect. And then put in an ErrorDocument directive, if there isn't one in place already.

you can get round it by redirecting to your error page and using PHP to handle the response code there
I think technically you'd have to rewrite to a php script which displays your error page and returns the 404 header. Otherwise you're right back where you started, only involving a different page.

Question that hasn't been addressed: Is this about random errors that can arise on any site? Or are there specific misspelled URLs getting requested over and over again, as when someone links to your site but gets something wrong? (A common one is auto-linking that inadvertently includes any following punctuation.) If you find specific wrong URLs getting requested again and again, then by all means redirect to the intended page.
1:48 am on Jan 10, 2019 (gmt 0)

New User

joined:Jan 8, 2019
posts:15
votes: 0


Thanks, all! Tremendously helpful.

@lucy24

Have not noticed specific URLs getting requested over and over. Just noticed when I mispelled a URL that it was redirected to the homepage.
6:53 am on Jan 10, 2019 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:8890
votes: 729


@TomSnow: welcome to Webmasterworld!

Remember 404 can be your BEST FRIEND. Besides letting SEs know ... you have a golden opportunity to MARKET the rest of your site with comment, instruction, and links to bits and pieces that might make the user inclined to investigate further. Just one click off that page into your website is GOLDEN.

Mistyped urls are not the worst thing ever, they are an OPPORTUNITY!
7:16 am on Jan 10, 2019 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Sept 7, 2006
posts: 1047
votes: 99


you can get round it by redirecting to your error page and using PHP to handle the response code there


@lucy24

Sorry, to be clear, you use the PHP header function to define the response, thus:

The defined error page is (e.g.) error-response.php.

At the top of that page (above the html) is:

<?php
header("HTTP/1.0 404 Not Found");
?>

Below this is your standard html.

In use, this displays the requested URL (e.g. .../mistyped.htm) in the address bar, and sends a 404 response for that URL. The html content of .../error-response.php displays in the browser.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members