Results 1 to 9 of 9
  1. #1
    RacingJim is offline Public Member
    Join Date
    May 2013
    Posts
    1,871
    Thanks
    878
    Thanked 1,365 Times in 841 Posts

    Default Redirecting to www version of site in Wordpress

    Idiot question coming up. i run most my sites in Wordpress and all of them except one redirect automatically to the www. version of the site.

    e.g. if someone wrote in their browser bettingsite.com

    My site would redirect automatically to www.bettingsite.com

    For some reason one of my sites is not doing this and I can't remember how to sort it out in Wordpress. Tried a Google search and not coming up with anything. Anyone?

  2. #2
    DanHorvat's Avatar
    DanHorvat is offline Private Member
    Join Date
    November 2008
    Location
    Actual location may vary.
    Posts
    1,897
    Blog Entries
    3
    Thanks
    1,302
    Thanked 1,289 Times in 760 Posts

    Default

    Add the code below in your .htaccess file.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^bettingsite\.com$ [NC]
    RewriteRule ^(.*)$ http://www.bettingsite.com/$1 [R=301,L]
    And don't forget to add both the non-www and the www version as individual websites to Google Webmaster Tools, and to choose the preferred version.

  3. #3
    edgarf76's Avatar
    edgarf76 is offline Private Member
    Join Date
    March 2013
    Location
    Montreal
    Posts
    1,852
    Thanks
    647
    Thanked 506 Times in 359 Posts

    Default

    Quote Originally Posted by DanHorvat View Post
    Add the code below in your .htaccess file.



    And don't forget to add both the non-www and the www version as individual websites to Google Webmaster Tools, and to choose the preferred version.

    Dan quick question about WP Smush it, They discontinued their service. I remember reading your article in the digital magazine about WPSMUSHIT. What do you feel are the best options now?

  4. #4
    RacingJim is offline Public Member
    Join Date
    May 2013
    Posts
    1,871
    Thanks
    878
    Thanked 1,365 Times in 841 Posts

    Default

    Just spent an hour messing about with this, turned out all my settings were fine, it was Firefox having a paddy attack as it was getting confused as previously it had saved the non-www version into its history (before me having it set to always go to the www version). Since then Firefox was confused about what was going on.

    Other browsers were working fine, so I deleted browser history and saved files in Firefox and hey presto. Jeeez. Just spent an hour on that.

  5. #5
    DanHorvat's Avatar
    DanHorvat is offline Private Member
    Join Date
    November 2008
    Location
    Actual location may vary.
    Posts
    1,897
    Blog Entries
    3
    Thanks
    1,302
    Thanked 1,289 Times in 760 Posts

    Default

    Quote Originally Posted by edgarf76 View Post
    Dan quick question about WP Smush it, They discontinued their service. I remember reading your article in the digital magazine about WPSMUSHIT. What do you feel are the best options now?
    I'm not using any on-the-fly image optimizer.

    I'm still editing my images in GIMP manually - those images I really really need optimized. The rest I just upload without any optimization. I don't think image size is an issue anymore, it really doesn't matter if it's 20 Kb or 150 Kb. It is no longer a bottleneck.

  6. The Following User Says Thank You to DanHorvat For This Useful Post:

    -Shay- (27 March 2015)

  7. #6
    TravG's Avatar
    TravG is offline Private Member
    Join Date
    September 2008
    Posts
    2,050
    Thanks
    34
    Thanked 179 Times in 130 Posts

    Default

    I use the images Google optimizes for you when you run the mobile and speed testing tool. They optimize all images for you in a zip file. You just unzip it and replace the images. It is a huge time saver that I just stumbled upon last week.
    Live Casino USA - the best USA live online casinos. Play USA online slots and other casino games like USA online blackjack. Like poker? See www.usalegalpoker.com for the best USA poker sites and USA online casinos for the best USA online casino. https://mobileslotslisting.com
    www.usalegalslots.com - www.playusaonlinepoker.com - www.4deucespoker.com

  8. #7
    baldidiot is offline Private Member
    Join Date
    January 2010
    Posts
    4,366
    Thanks
    407
    Thanked 1,996 Times in 1,314 Posts

    Default

    Quote Originally Posted by RacingJim View Post
    Idiot question coming up. i run most my sites in Wordpress and all of them except one redirect automatically to the www. version of the site.

    e.g. if someone wrote in their browser bettingsite.com

    My site would redirect automatically to www.bettingsite.com

    For some reason one of my sites is not doing this and I can't remember how to sort it out in Wordpress. Tried a Google search and not coming up with anything. Anyone?
    If you've not already done this using htaccess you can also do it in wordpress in about 30 seconds:

    1. Go to Settings > General

    2. Change 'Wordpress Address (URL)' and 'Site Address (URL)' to the format you want (eg: if it says http://example.com change it to http://www.example.com
    onlinegamblingwebsites.com - Formally known as goodbonusguide.

  9. The Following User Says Thank You to baldidiot For This Useful Post:

    -Shay- (27 March 2015)

  10. #8
    RacingJim is offline Public Member
    Join Date
    May 2013
    Posts
    1,871
    Thanks
    878
    Thanked 1,365 Times in 841 Posts

    Default

    Quote Originally Posted by baldidiot View Post
    If you've not already done this using htaccess you can also do it in wordpress in about 30 seconds:

    1. Go to Settings > General

    2. Change 'Wordpress Address (URL)' and 'Site Address (URL)' to the format you want (eg: if it says http://example.com change it to http://www.example.com
    Yep that's the correct way, cheers matey, i already had it like that. But because I previously had it without 'www' and then changed it to with www, my browser had cached an old version of the without and kept showing me that. I had a mare for one hour before I realised it was just browser caching issues, duuuuh.

  11. #9
    ryanrajpoot is offline New Member
    Join Date
    March 2015
    Location
    India
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You can use this, i am also using the same.

    Code:
    # Redirect non-www to www
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •