![]() | | ||||||||
| | #1 |
| HyperActive Warrior War Room Member Join Date: Nov 2009 Location: Melville, NY
Posts: 190
Thanks: 38
Thanked 50 Times in 30 Posts
|
Has anyone seen or used an automatic 301 Plugin (redirect) for WordPress? I've found several plugins, but they require you to define the missing page and set up a redirect. What I want is this - if someone goes to a non-existing page, instead of getting a 404 error (and a 404 in the header sent back to the browser) I instead want it to send a 301 to a specific page (if that 404 page was configured and mapped) OR send to the home page with a 301 if that specific page was not mapped. The idea is that there will never be a 404 error on the site and if there is a missing page we treat it as a 301 to the home page. Has anyone seen this? Thanks! |
| I'll tell you exactly I think. Take advantage of anything I get right and ignore anything I get wrong. Search Engine Marketing with Pay Per Click Advertising, SEO and Lead Generation campaigns. | |
| | |
| | #2 |
| HyperActive Warrior War Room Member Join Date: Jun 2008 Location: Southern Indiana
Posts: 159
Thanks: 27
Thanked 14 Times in 13 Posts
|
Put the redirect at the top of your 404.php file in your theme. <? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.new-url.com" ); ?> |
| | |
| | #3 |
| HyperActive Warrior Join Date: Nov 2009 Location: Thailand
Posts: 147
Thanks: 11
Thanked 24 Times in 19 Posts
|
There is a wordpress plugin called link juice keeper that does exactly what you want.
|
| | |
| | #4 |
| SEO Strategist War Room Member Join Date: Jun 2010
Posts: 6,533
Thanks: 355
Thanked 1,993 Times in 1,274 Posts
|
I do what DeskCoder does above with some of my sites 404.php pages. Here is the Wordpress 404/301 redirect code I use. ![]() This will redirect 100% of all broken links back to the Wordpress blogs Index page. The code above is the only code inside my 404.php file. [edit] The forum keeps breaking my php code, that's the reason for the code/screenshot. |
| | |
| | |
| | #5 |
| HyperActive Warrior War Room Member Join Date: Nov 2009 Location: Melville, NY
Posts: 190
Thanks: 38
Thanked 50 Times in 30 Posts
|
Thanks for the tips. I will test these methods. I want to be sure the browser (i.e., Google) receives a true 301 and not a 404 code with a redirect attached. Thanks again! |
| I'll tell you exactly I think. Take advantage of anything I get right and ignore anything I get wrong. Search Engine Marketing with Pay Per Click Advertising, SEO and Lead Generation campaigns. | |
| | |
| | #6 |
| HyperActive Warrior War Room Member Join Date: Jun 2008 Location: Southern Indiana
Posts: 159
Thanks: 27
Thanked 14 Times in 13 Posts
|
I didn't think about the status code ... but I just checked in Firebug (NET panel), and there is no 404, just a 301 if you add the php redirect to the top of the 404.php page.
|
| | |
![]() |
|
| Tags |
| 301, automatic, plugin, wordpress |
| Thread Tools | |
| |
![]() |