WordPress Plugin: 404 Simple Redirect

You can download my WordPress Plugin: 404 Simple Redirect clicking here.

What does the plugin?

This plugin hooks the normal WordPress workflow in order to determine if the request is processing will cause a 404 HTTP error. In that case it prevents WordPress to do any other processing and sends the user to the page defined in the plugin options.

How do I install de plugin?

Just download it from the WordPress plugins repository, activate it and enjoy!

Plugin info

Current version: 1.2
Author: Jordi Plana
Release log:

1.2

  • Fixed empty URL bug +info
  • Added localization

1.1

  • Fixed typo errors
  • Added settings link from plugin page

1.0

  • First version

 

19 Comments

  • Rick
    May 17, 2012 - 11:26 pm | Permalink

    Hi there, your download link actually goes to your Open Graph plugin.

  • May 18, 2012 - 2:52 am | Permalink

    thank buad infonya.

  • Pingback: Procurando por plugin para wordpress?Veja os 9 melhores!

  • July 18, 2012 - 3:01 pm | Permalink

    I have a white label site. I want to redirect visitors who come from search engines to the white label. I cannot use the white label in the search URL. Is there a redirect plugin that I can build on my site that will zap visitors, without much pain, straight to the white label. I don’t want visitors to stop on my site, just pass by it. Is that reasonable? can it be done?
    Ed C

    • August 23, 2012 - 11:32 am | Permalink

      Hi Ed,
      I think you can do some kind of user redirection based on the referrer.
      There are a lot of different ‘referrer detection’ technics: javascript, php, etc. You will only need patiente and some coding skills.
      Regards!

  • Mav
    September 19, 2012 - 3:52 am | Permalink

    Hi Jordi,

    First of all, I’m a newbie on webhosting and wordpress.

    I’ve found out your plugin is very simple to implement and I like it. Due to some reading of 301 redirecting may cause duplication read by google and affect search ranking.

    My website will be a property website. Those sold or rented properties will be taken out and I would like them to redirect to main page. Since I dont know much about redirecting a 404 page, will this cause duplication of content? If it won’t, could you enlighten my newbiness =D

    Thx!

    • September 19, 2012 - 10:20 am | Permalink

      Hi Mav,

      Thanks for using the plugin!

      404 Simple Redirect Plugin redirects using a default HTTP 302 header. This 302 status means that the page has temporary moved.

      I think that if the plugin used a 301 HTTP header instead search engines will read the redirection as duplicated content. 301 redirection is the correct way to tell search engines that the content in that URL has been moved definetely to the new one, so with 302 you shouldn’t worry about penalization.

      Another interesting thing would be keeping that old property pages, they may add you some page thickness and search engine visitors. Think about how can you keep this pages in order to keep visitors coming from crawlers.

      There have been lots of discussions on how do search engines treat 302 redirections, I leave here some interesting links about it:

  • September 20, 2012 - 7:36 am | Permalink

    Hola, te escribo porque el plugin me encanta por ser tan sencillo y funcional. El caso es que en mi sitio también uso Google Search en el sitio y cuando hago cualquier tipo de búsqueda en vez de darme algún resultado me manda a la página que utilizo para la redirección del plugin. Incluso probe a cambiar la redireccion a otra URL pero no funciona, la web no me muestra los resultado de búsqueda.

    Sabes a que se puede deber?

    Gracias y un saludo.

    Cento

    • September 20, 2012 - 8:45 am | Permalink

      Hola Centro,
      Gracias por utilizar el plugin.

      Este comportamiento que me comentas es muy inusual. Si te está redirigiendo a la página configurada en las opciones del plugin es porque la petición de la página que va a servir WordPress genera un código de error 404.

      Utiliza Firebug o Chrome Inspector en la pestaña de Red para averiguar a qué URL está atacando la petición POST que envía el formulario de búsqueda. Es posible que esa URL sea errónea, o WordPress no sepa interpretarla (debido a estructura de permalinks por ejemplo) y esté causando el error 404 que te comento.

      Espero haberte ayudado.

      Un saludo

    • September 20, 2012 - 10:53 am | Permalink

      La cuestión es que cuando lo desactivo (el plugin) todo funciona correctamente, por eso no entiendo el comportamiento, porque en principio los resultados, al meter una busqueda es extraño que de error 404 ya que es google search cuyos resultados los tengo predeterminados en una pagina especifica de mi blog.

      No se si sabes como va la configuración de Google Search o si se puede meter un condicional al plugin o algo.

      No se si me explico.

      • September 20, 2012 - 1:35 pm | Permalink

        Hola Cento,
        Por lo que veo en tu página el formulario de búsqueda es incorrecto. La action que tiene assignada actualmente es: todoiphone.net/resultados-de-la-busqueda cuando debería ser http://todoiphone.net/resultados-de-la-busqueda. Fíjate que la URL debe contener http://, en caso contrario interpreta que se trata de una ruta relativa (y no debería contener la URL base de tu sitio).

        Cambia este valor en tu template y verás que funciona correctamente. Yo he hecho la prueba via Firebug y ha funcionado.

        Coméntame si solucionaste el problema.

        Un saludo

        • September 20, 2012 - 5:10 pm | Permalink

          La verdad que he realizado la prueba y ha funcionado correctamente, lo extraño es que el código que tenía puesto yo lo había generado google, el caso es que no estaría mal que lo pusieras en las FAQS.

          Por cierto, ya lo he dicho, pero excelente trabajo con el plugin.

          Me encanta. Las herramientas para web masters de Google me limpio de errores de un día al otro.

          Gracias!!!

  • October 5, 2012 - 9:58 am | Permalink

    Hello
    First of all I want to thank you for great plugin that you brought.
    He works perfectly, but…..

    I have a problem
    On my blog I use:
    404 simple redirect plugin and another redirect plugin for my external links.

    So that plugin makes external links like http://www.mysite.com/****/http://external link/
    where ***** – prefix which I set in the external links plugin settings.

    And when i click on some external link, 404plugin redirect me to my home page(mysite.com/home.php- the page that is specified in the 404plugin settings)

    My question is: how create the exception in the 404plugin options form for links like /****/http://external link****/

    Sorry for my bad english.

    • October 8, 2012 - 7:36 am | Permalink

      Hello Questionman,
      Thanks for using the plugin.

      Can you please tell me which other plugin do you use for external redirections. I would like to test how do the two plugins work.

      Regards

      • October 9, 2012 - 8:53 pm | Permalink

        I’m using (J)ExR plugin
        official page is here http://jawsik.com/wordpress/jexr.php
        you can download plugin here http://jawsik.com/?file_id=11
        author from russia, plugin have only rus. language, but it simple to configure, so I hope you will help me with my problem))

        • October 10, 2012 - 9:16 am | Permalink

          Hello Questionman,
          I downloaded the plugin you told me. The (J)ExR plugin triggers the redirection on template_redirect action. This action takes places after wp action, which is used by 404 Simple Redirect to do the redirection.

          You should try to change line 310 of (J)ExR plugin.

          Change this:
          add_action('template_redirect', 'j_global_redirect');

          Into that:
          add_action('wp', 'j_global_redirect', 9);

          Tell me if you solved your problem.
          Regards

  • October 10, 2012 - 9:29 pm | Permalink

    So much thanks to you, Jordi!!
    Now everything works perfectly!!!

  • MacItaly
    October 26, 2012 - 11:01 pm | Permalink

    Adding update to my previous comment.
    I wrote to Arnan De Gans, the AdRotate plugin developer and he suggested to make an exception to 404 SR to not intercept AdRotate redirections, what about?

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>