Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Htaccess 301 redirect advice

Options
  • 06-09-2013 4:42pm
    #1
    Registered Users Posts: 511 ✭✭✭


    A client is re-branding, which in turn means they are changing their domain name.

    We have purchased the new domain and moved the site across. We have submitted the site change to Google via Webmaster Tools.

    We now need to set up 301 redirects for all of the pages on the old site to the corresponding pages on the new site.

    The url structure will be the same, except for the part before the .com.

    Instead of manually adding the following in the .htaccess file:

    Redirect 301 /benefits/ http://www.newdomain.com/benefits/
    Redirect 301 /contact/ http://www.newdomain.com/contact/

    Can anyone recommend a program to automatically do the above? There are hundreds of pages, which will be time consuming to do manually.


Comments

  • Registered Users Posts: 1,801 ✭✭✭cormee


    Are you looking to do a blanket redirect?

    If so:

    Redirect 301 / http://www.newdomain.com


  • Registered Users Posts: 511 ✭✭✭D Hayes


    Yes, it's a blanket redirect.

    Will your suggestion cover redirects for every page on the site?


  • Registered Users Posts: 1,801 ✭✭✭cormee


    Yes


  • Registered Users Posts: 511 ✭✭✭D Hayes


    cormee wrote: »
    Yes

    Thanks. I was over complicating things big time!


  • Registered Users Posts: 1,256 ✭✭✭blue4ever


    In order to redirect , say www.oldsite.com/contacts to www.newsite.com/contacts - ie every page is redirected to the new site under the same URL structure- stick this in your .hrtassess

    RewriteEngine on
    RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]

    I'd test it first!

    Also, imo, - this should have been done before the search engine submission!

    C


  • Advertisement
  • Registered Users Posts: 511 ✭✭✭D Hayes


    blue4ever wrote: »

    RewriteEngine on
    RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]

    C

    Thanks for that. I presume that's the same as what cormee suggested in his first post, just in a different format?


  • Registered Users Posts: 1,256 ✭✭✭blue4ever


    This keeps the structure intact - the bit after the $ saves the url after the old domain name and appends it to the new domain name


Advertisement