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

Website Redirection

Options
  • 11-06-2010 12:23pm
    #1
    Registered Users Posts: 1,340 ✭✭✭


    Hi guys

    I was wondering if someone would be able to give me a quick bit of advice on something I reckon is probably very simple but I keep failing at!

    I have just taken over the running of a church website and have developed a wordpress blog to replace the current site. I installed Wordpress and built the new site in a sub directory. Eg www.site.ie/new. Now that I have finished I want that page to become where visitors automatically go to when they type in www.site.ie. However, we have a really good Google ranking so I don't want to muddle that up too much by changing too much stuff in the directories. It seems that a "301 Redirect" is a good way to go , but everytime I try this it simply fails.

    I put the little code that I've found on various online tutorials into the already existing file called .htaccess. However, when I go to the homepage of the site i) it doesn't redirect and ii) if I go to www.site.ie/new (which its meant to be redirecting it to) the page no longer appears. If i delete the code from that file everything opens again fine but obviously it doesn't redirect.

    Any help would be appreciated!!

    Cheers


Comments

  • Registered Users Posts: 354 ✭✭fergalfrog


    Which folder are you putting the htaccess file into? Perhaps post it here just in case there is a mistake in it.

    Also is it the case that www.site.ie/new is doing well on google and you want to preserve that (that is the way I read it)?

    You should be able to set up your htaccess such that the same content is delivered regardless of whether users got to www.site.ie/new or www.site.ie


  • Registered Users Posts: 16,413 ✭✭✭✭Trojan


    There's a couple of different ways to go here. Here's one way I might do it, depending on the site. This is assuming the WP install at /new isn't indexed and you don't want it indexed.

    0. Back up the whole site, files and SQL.

    1. Make sure you know what pages are indexed.

    First of all, go google "site:yourdomain.tld" in google to find out what page addresses google has indexed. Make a list, keep it in a spreadsheet if you have a lot of pages. (You can also find this info in Webmaster Tools).

    2. Make sure that every page in the old site has an equivalent in your WordPress install.

    If the URLs are different e.g. if old site had "workshops.htm" and now it's "/workshops/" etc in Wordpress.

    3. Create a redirect for each URL.

    Create a .htaccess in the site root directory (i.e. at www.yourdomain.tld/.htaccess) containing an entry for every URL that is index, containing the old and the new url (without the /new prefix), e.g.
    ReDirect 301 /news.htm [url]http://www.yourdomain.tld/blog/[/url]
    ReDirect 301 /enquiry.htm [url]http://www.yourdomain.tld/contact-us/[/url]
    ReDirect 301 /privacy-policy.htm [url]http://www.yourdomain.tld/policies/[/url]
    

    4. Delete the old site files, move everything from /new into /

    You may need to edit WordPress settings to ensure location is ok and everything is resolving correctly.

    Occasionally, if you really mess around here you might have to go and edit the MySQL database - search it for "/new".

    5. Test everything again.


Advertisement