Mobile app version of vmapp.org
Login or Join
Deb1703797

: Automatic redirect of all deleted webpages (that doesn't have a specific redirection) to root? I want to create an automatic 301 redirect of all deleted webpages (that doesn't have a specific

@Deb1703797

Posted in: #Redirects

I want to create an automatic 301 redirect of all deleted webpages (that doesn't have a specific redirection) to root, in .htaccess .

Instead of using the following pattern for each of my ~ 150 deleted urls, I want all to redirect to the Homepage:

Redirect [status] URL-path URL


Yet, 2 things are important for me:


Specific redirects like in the following code, won't be affected.
The redirect shouldn't be for a specific domain, but rather for the root, whatever it is named; This is good in case tomorrow I decide to change the site's domain.


The reason I want to create these 301 is because ~ 150 links that I deleted about 2 to 3 years ago are still time and again considered "404" by Google, even though I clicked "mark as fixed" about 10 times now.

BTW 95% of these 404's are Hebrew aliases, and now, from various reasons, I use only English aliases (I've written on this here), so basically it's not a big deal for me to permanently block them or just redirect them to my homepage.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Deb1703797

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sent6035632

I agree with norcal johnny's answer; using a 301 redirect for deleted pages doesn't make sense.

It's also potentially disruptive, if (for example) I write down a URL on a piece of paper and then type it in, and make a mistake. Now, instead of fixing the mistake any trying again, I have to re-type the URL all over again, because the 301 caused the browser's address bar to change. In an extreme case, I might not even realize at first that I made an error.

Hard 404s are normal. Just provide some relevant links; at the very least, provide a clear link back to the front page of your site.

Soft 404s (a "not found" page served with a 200 OK status code) is a serious problem for some use cases. Never, ever serve soft 404s. Like Yoda says, do, or do not; there is no try. Content either exists or it does not exist, and the response status code should reflect its existence. Schrödinger's cats are for physicists.

As for your last point,


in case tomorrow I decide to change the site's domain


you really should read and contemplate Cool URIs don't change from 1998. It's somewhat dated in parts, but the message remains highly relevant to this day. You control the mapping between the URI and the content; make sure that mapping is sensible, and URIs will remain stable even during major content overhauls.

10% popularity Vote Up Vote Down


 

@Heady270

FINAL ANSWER UPDATE

So I just learned the reason the OP wants to use 301 redirect is get rid of the annoyance of recurring errors even though new site maps have been submitted and marked as fixed.

Use a 410 redirect to completely remove the URL's from index and recurring 404 error notices.

To remove a directory, add something like this to you htaccess file:

Redirect 410 /path_to_directory


Here is what Google has to say about 404 removals:


Make removal permanent

The Remove URLs tool is only a temporary removal. To remove content or a URL from Google search permanently you must take one or more of the following additional actions:


Remove or update the actual content from your site (images, pages,
directories) and make sure that your web server returns either a 404
(Not Found) or 410 (Gone) HTTP status code. Non-HTML files (like
PDFs) should be completely removed from your server. (Learn more
about HTTP status codes)
Block access to the content, for example by requiring a password.
Indicate that the page should not to be indexed using the noindex
meta tag. This is less secure than the other methods.





A 301 redirect for deleted pages doesn't make sense.
A redirect tells a user and search engines a page or site name has moved and you direct/point them to the new correct page or URL.

That is not the case here.
A 404 error will work fine and what most people do not realize is, 404 error pages do not affect your ranking. Google simply asks that 404 error pages should at least have a link a user can still navigate with. A nice little description is better for the user (ie. the page you are looking for no longer exists and maybe have a link to the home page and or category that may be similar.

That is what the real situation is and not this current page has permanently moved to this page. If it doesnt add up to the user it wont to the search engine as well.

If you change your domain name, a 301 redirect is the right method.

With custom 404 pages you can have fun or be creative and get a chance to use CTA's. It is more engaging than redirecting them from where they thought they were going, to someone imposed on them.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme