1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wordpress Redirects. Help!

Discussion in 'Blogging' started by imogen, Nov 30, 2012.

  1. imogen

    imogen Newbie

    Joined:
    Sep 1, 2012
    Messages:
    40
    Likes Received:
    11
    Location:
    Australia
    My wordpress blog has been linked like http://mysite and I want to attempt to pass that to http://www.mysite. Most people seem to have the opposite problem... they want to redirect the http to the www. Now I don't really know exactly what I'm doing here, but I'm aware that I've screwed up somehow. Google is (obviously) seeing the two as separate sites which is messing with my authorship and diluting my linkjuice.

    I have the Redirect plugin but have failed to find any information on how to do a sitewide redirect in this order.

    Can anyone help?
     
    • Thanks Thanks x 1
  2. styles81

    styles81 Junior Member

    Joined:
    Jun 23, 2011
    Messages:
    100
    Likes Received:
    40
    Location:
    BHW
    Go to settings in your wordpress dashboard and click the general link. You will find your answer there
     
  3. imogen

    imogen Newbie

    Joined:
    Sep 1, 2012
    Messages:
    40
    Likes Received:
    11
    Location:
    Australia
    That will allow me to change it but not setup a redirect. :(
     
  4. Endire

    Endire Elite Member Premium Member

    Joined:
    Mar 27, 2012
    Messages:
    1,756
    Likes Received:
    1,061
    Gender:
    Male
    Imogen,

    To perform a sitewide redirect you could add a directive in your .htaccess file (assuming your hosting provider supports use of this server configuration file). Do you know how to upload documents to your hosting account using a file transfer client?

    If you do just put this in your .htaccess file,

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain\.com [NC]
    RewriteRule (.*) http://www.domain.com/$1 [L,R=301]


    Here is a tutorial on how to upload the file to your root domain,

    http://wiki.filezilla-project.org/FileZilla_Client_Tutorial_(en)

    Note you may also be able to configure this file through your hosting account cpanel.

    Hope that helps you,

    Shawn
     
    • Thanks Thanks x 1
  5. imogen

    imogen Newbie

    Joined:
    Sep 1, 2012
    Messages:
    40
    Likes Received:
    11
    Location:
    Australia
    I added the info to my .htaccess file and unfortunately the site then gave the error: Too many redirects. Have put the old file back. :(

    Not sure I can win this one!
     
  6. builder

    builder Junior Member

    Joined:
    Jul 31, 2009
    Messages:
    100
    Likes Received:
    17
    You will be redirected.

    Just try it!
     
  7. imogen

    imogen Newbie

    Joined:
    Sep 1, 2012
    Messages:
    40
    Likes Received:
    11
    Location:
    Australia
    TheContentAuthority: Thank you so much for your detailed response. Unfortunately, I tried editing the .htaccess file with the (edited) information you provided, and on a separate occasion tried to do the same thing with the Redirection plugin for WP. Both give the attached error.

    redirect-loop.png

    builder: I tried this too and sadly this resulted in the temporary death of my website and my access to the admin panel. :( I had to use phpMyAdmin to change the addresses back. It's okay now, but I'm guessing that option isn't going to work here either.

    I'm wondering if this is a loop issue due to WP's default canonical URLs. Wondering if I disable canonical URLs and then change the .htaccess if this might do the trick. I'm a little concerned that this will work against me in the serps instead of optimising because obviously, canonical URLs are there for a reason.
     
    Last edited: Nov 30, 2012
  8. Endire

    Endire Elite Member Premium Member

    Joined:
    Mar 27, 2012
    Messages:
    1,756
    Likes Received:
    1,061
    Gender:
    Male
    Imogen,

    Sorry you are having problems. Did you have your redirect plugin disabled when you tried the .htaccess route? If not, try disabling or even uninstalling that plugin before you make changes to the .htaccess file.

    Also, be sure that the .htaccess file is named appropriately on your server. Sometimes when you edit it in notepad or another program it will change the file name.

    Also, try setting your permalink settings back to default before adding the redirect code to .htaccess.

    Let me know if that doesn't help
     
    • Thanks Thanks x 1
  9. imogen

    imogen Newbie

    Joined:
    Sep 1, 2012
    Messages:
    40
    Likes Received:
    11
    Location:
    Australia
    Plugin wasn't installed when I tried the .htaccess redirect and the file is definitely named correctly. I tried setting the permalinks back to default and then adding the redirect but this resulted in not being able to load the site at all... it just sat there and spun, didn't even give an error.

    Have you had any experience with disabling WP's default canonicals? I'd like to give that a try but I'm super nervous about the repercussions.

    Edit: Found this tidbit... "You might have issues, however, if you have enabled your own form of canonical URL redirection that isn't redirecting the the URLs that WordPress thinks are the canonical version. For instance, if your blog is http://www.example.com/blog/ but you have a line in your .htaccess that redirects people to http://example.com/blog/, you're not going to be able to access your site, as the two redirects will "fight" each other in an infinite loop until the browser gives up."

    That looks about right.
     
    Last edited: Nov 30, 2012
  10. imogen

    imogen Newbie

    Joined:
    Sep 1, 2012
    Messages:
    40
    Likes Received:
    11
    Location:
    Australia
    Have installed the Fix Multiple Redirects plugin and then again edited the .htaccess file with the information provided by TheContentAuthority.

    So far so good!

    Thanks to everyone who helped with this one. Will let you know if it sticks.