Support » Plugins and Hacks » [Resolved] Where to add 301 Redirects?

[Resolved] Where to add 301 Redirects?

Viewing 15 replies - 1 through 15 (of 51 total)
  • Plugin Author AITpro


    This is an online htaccess redirect code generator >>> http://www.htaccessredirect.net/

    It is going to depend on what you are trying to redirect and to where.
    Please post specific examples of what you are trying to do. Also are the redirects inside the WordPress rewrite loop or outside the WordPress rewrite loop?

    //301 Redirect Old File
    Redirect 301 somefile.php somefile-new-location.php

    //301 Redirect Entire Directory
    RedirectMatch 301 /some-folder/(.*) /some-new-folder-location/$1

    Plugin Author AITpro


    Did this info answer your question? If so, please resolve this question. Thanks.

    Plugin Author AITpro


    Ok well i guess you are crazy busy so i am resolving this thread. please reopen it if you need any other info. Thanks.


    Well, the redirects are sort of outside the loop. This is a redirect I’d like to happen:

    should redirect to
    http://www.wepcoinc.com/smartroller/ (now WordPress)

    I see the link you gave me. What would you like me to do with the code that it generates? Where would that go?

    Thank you!

    Plugin Author AITpro


    Ok then you would do something like this then if you are in the scenario of generally trying to redirect ALL old html pages from a site that was previously an HTML site to a new site that is now WordPress.


    You would add your redirect code to BPS Custom Code, save this code, then click the AutoMagic buttons and activate BulletProof Mode for your Root folder again.
    Root htaccess File Custom Code

    CUSTOM CODE TOP: Add php.ini handler code and / or miscellaneous custom code here

    …Add your new redirect custom code here…

    Hi there,

    Thanks! However, some pages are going to be different.

    There will probably be a few like this:

    redirects to

    So do I follow the same instructions (as in adding the code to the BPS custom code, etc.)?

    Thank you!

    Plugin Author AITpro


    how many pages total do you have to redirect? it might be better to just do the redirects individually if you only have a small number of them – 100 pages or less to redirect.

    Plugin Author AITpro


    so if you want the simplest and most basic redirect method for a small number of redirects then here it is:

    This redirects a file named example-page.html that is in the website root folder to a blog post named conveyors. Your redirect for home_r1.html to blog post conveyors is also shown.

    RedirectMatch 301 /example-page.html /conveyors/index.php
    or without displaying index.php
    RedirectMatch 301 /example-page.html /conveyors/
    RedirectMatch 301 /home_r1.html /conveyors/index.php
    or without displaying index.php
    RedirectMatch 301 /home_r1.html /conveyors/
    Plugin Author AITpro


    I assume this answered all of your questions. Resolving this thread. Thanks.

    Thank you for the information!

    I have followed your instructions with regard to using the custom code and for the first time (from the various methods I have tried), the redirect is working. However, the redirect is going to the main page, rather than the desired page.

    This is all on the same domain… I am cleaning up old .php and .html pages that have been replaced with WordPress pages.

    Is there another setting that is forcing redirects to the main page?

    This is the redirect I tested with:
    Redirect 301 /immunocal.science.php http://www.immunocal.md/science/

    When I go to the old URL, I arrive at immunocal.md

    What is my next step?


    Plugin Author AITpro


    Use RedirectMatch instead of redirect and in your case it is important to escape the dot otherwise the dot will match more than just a single/literal dot and match anything. I am not sure why you were adding the domain name. You are just trying to match and redirect the file named science.php correct?

    RedirectMatch 301 ^/science\.php$ http://www.immunocal.md/science/

    Plugin Author AITpro


    comment/code was updated…

    No, the original page is http://immunocal.md/immunocal.science.php

    In fact, the very first page was with .html extension, so I have to redirect that one also. I have a whole list of pages to redirect.

    Plugin Author AITpro


    Well that might be a problem since your file name is the same as your domain name and could cause a redirect loop, but it may not – very strange file name??? Try it…

    RedirectMatch 301 ^/immunocal\.science\.php$ http://www.immunocal.md/science/

    Yes, I was (and still am) learning about SEO…

    I will try doing one of the files that does not contain immunocal in the name and will also try your suggestion… back shortly.

Viewing 15 replies - 1 through 15 (of 51 total)
  • The topic ‘[Resolved] Where to add 301 Redirects?’ is closed to new replies.