Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirecting 404 error with .htaccess via 301 for SEO etc

I couldn't find a straight answer to my question and need to know it from the real experts.

I had a website which urls were generated by Joomla. I believe that tons of urls are around in the search engines and I really don't know which of them all. A 302 redirect would be an option, but I can't say which urls need to be redirected.

The only thing I know that all the urls were generated by a sef404 script, it's a SEO script for Joomla.

My question, how can I make sure that all the orphan urls on google and other search engines are delivered correctly with a .htaccess file?

How do I 301 redirect all 404 pages to the homepage (root document)

At the moment I use a custom 404.html error file, but there are too many files and will give a rollercoaster of custom 404 error pages

like image 641
Chris Avatar asked Mar 02 '10 13:03

Chris


People also ask

How do I redirect 404 to 301?

Installing the plugin – Simple Alternatively, download the plugin and upload the contents of 404-to-301. zip to your plugins directory, which usually is /wp-content/plugins/ . Go to 404 to 301 tab on your admin menus. Configure the plugin options with available settings.

Are 301 redirects good for SEO?

301 Redirects are considered best practice in SEO – even if the difference between the two styles of redirects is fairly minimal. For SEO, permanent redirects are usually the way to go. 301 HTTP responses tell the browser, and the users, that the original pages have been “moved permanently” to the destination URL.

What is a 301 .htaccess redirect?

What Is a 301 Redirect? A 301 redirect is a permanent redirect. When a user tries to access an old URL, the server sends their browser the 301-Permanently Moved status code and sends them to another page. This is useful for site owners and users because it means they are directed to the next most relevant page.

Should I enable 301 .htaccess redirect?

Because the WordPress 301 redirect is not always reliable, we recommend issuing the 301 redirect via your . htaccess file. Another benefit is that the . htaccess redirect is slightly faster than redirecting via PHP, because it is loaded even before the rest of the page.


1 Answers

I came up with the solution and posted it on my blog

http://web.archive.org/web/20130310123646/http://onlinemarketingexperts.com.au/2013/01/how-to-permanently-redirect-301-all-404-missing-pages-in-htaccess/

here is the htaccess code also

RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . / [L,R=301] 

but I posted other solutions on my blog too, it depends what you need really

like image 150
andrew Avatar answered Sep 20 '22 09:09

andrew