Results 1 to 13 of 13
  1. #1
    krasloten24's Avatar
    krasloten24 is offline Private Member
    Join Date
    July 2009
    Posts
    67
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default How to redirect http:// to http://www

    I have the following question,

    I want to redirect http:// to http://www with a .HTACCES file I found this article Click but it doens't work when i copy the following code into the .HTACCES file and changed the parameters:

    PHP Code:
    RewriteEngine On
    RewriteCond 
    %{HTTP_HOST} !^www\.mt-example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.mt-example.com/$1 [L,R=301] 
    Does anyone have any experience using this?

    Thanks in advance,
    Informatie en reviews over online krasloten.
    http://www.krasloten24.nl
    Information and reviews about online scratch cards.
    http://www.play-scratchcards.co.uk
    Informationen und Berichte über Online Rubbellose.
    http://www.rubbellose-spielen.org

  2. #2
    casinojack's Avatar
    casinojack is offline Public Member
    Join Date
    February 2009
    Location
    Under Anthony's bed.
    Posts
    1,427
    Blog Entries
    2
    Thanks
    774
    Thanked 454 Times in 301 Posts

    Default

    Quote Originally Posted by Schoonbeek View Post
    I have the following question,

    I want to redirect http:// to http://www with a .HTACCES file I found this article Click but it doens't work when i copy the following code into the .HTACCES file and changed the parameters:

    PHP Code:
    RewriteEngine On
    RewriteCond 
    %{HTTP_HOST} !^www\.mt-example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.mt-example.com/$1 [L,R=301] 
    Does anyone have any experience using this?

    Thanks in advance,
    Not sre if you realize there i in an exmaple int hat

    try this"

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^(www.|$) [NC]
    RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    "CasinoJack"
    Skype:brianrocksit


  3. #3
    Simmo! is offline Public Member
    Join Date
    July 2004
    Posts
    893
    Thanks
    239
    Thanked 406 Times in 226 Posts

    Default

    If it's for SEO (what other reason LOL) and you use Webmaster Tools in Google it gives you the option to set it there too.

  4. #4
    RayUK's Avatar
    RayUK is offline In Memorian, 1964-2016
    Join Date
    January 2009
    Location
    England
    Posts
    322
    Thanks
    51
    Thanked 75 Times in 63 Posts

    Default

    There is a slightly different format given here:

    http://www.htaccesstools.com/article...cess-redirect/

    Just as a possibility if you can't get the above suggestions to work! I have never used it. I will have to use .htaccess at some point. RegExps are something I have struggled with for years and still have trouble
    Ray
    Fun Bingo Online Facebook Twitter

    Tu ne cede malis sed contra audentior ito

  5. #5
    Pokerworx is offline Private Member
    Join Date
    March 2009
    Posts
    90
    Thanks
    3
    Thanked 18 Times in 12 Posts

    Default

    You can make a .txt file and set all the address you find with the non www and set them to the www like

    /
    Code:
    redirect 301 http://yoursite.com/page1.html http://www.yoursite.com/page1/
    redirect 301 http://yoursite.com/page1.html http://www.yoursite.com/page1/
    Typically its

    redirect 301 (space) page/folder or address you want to move (space) address to move it to.

    Then save the file as 1.htaccess and rename it to .htaccess

    In google webmaster tools you might want to set your site to display as http://www.

  6. #6
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Sinking Faster, just when I thought it couldn't get worse it did!
    Posts
    25,036
    Thanks
    1,507
    Thanked 7,030 Times in 4,478 Posts

    Default

    What is strange is that I tried to set a preferred domain in webmaster tools and it says in order to do that it has to be verified I own the domain.

    I use an email from the domain, and have had a verified account for a long time.

    I had already verified the acount with a unique html (long time ago) page so what else needs done?

    Rick
    Universal4
    Gambling World Online Roulette Online Blackjack Live Online Games Sports Betting Horse Racing
    Casino Affiliate Programs
    Hosting and Domain Names
    Gambling Industry Association
    GPWA Moderation by Me and My Big Bad Security Self
    If an affiliate program is not small affiliate friendly (especially small US Affiliate), then they are NOT Affiliate Friendly!

  7. #7
    tryme's Avatar
    tryme is offline Public Member
    Join Date
    March 2009
    Posts
    306
    Blog Entries
    5
    Thanks
    35
    Thanked 135 Times in 94 Posts

    Default

    Casino Jack's format is spot on. However, it looks like the code you're using redirects from www.yoursite.com to www.yoursite.com which isn't what you want.

    Here's the .htaccess code you need to use that will work:

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

    Simply replace domain.com with the name of your domain and you're good to go.

  8. #8
    krasloten24's Avatar
    krasloten24 is offline Private Member
    Join Date
    July 2009
    Posts
    67
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    Alright thank you very much guys I will try it and let you know.

    In Google I have set the preferred domain to but when somebody links to http://mysite.nl instead of http://www.mysite.nl the linkjuice goes to http://mysite.nl so thats the reason I want to use this.
    Informatie en reviews over online krasloten.
    http://www.krasloten24.nl
    Information and reviews about online scratch cards.
    http://www.play-scratchcards.co.uk
    Informationen und Berichte über Online Rubbellose.
    http://www.rubbellose-spielen.org

  9. #9
    krasloten24's Avatar
    krasloten24 is offline Private Member
    Join Date
    July 2009
    Posts
    67
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by universal4 View Post
    What is strange is that I tried to set a preferred domain in webmaster tools and it says in order to do that it has to be verified I own the domain.

    I use an email from the domain, and have had a verified account for a long time.

    I had already verified the acount with a unique html (long time ago) page so what else needs done?

    Rick
    Universal4
    Google isn't always right, I had this error to when I had set an preffered domain. But the next day it was gone, mayby it takes some time for google to realise all of this.
    Informatie en reviews over online krasloten.
    http://www.krasloten24.nl
    Information and reviews about online scratch cards.
    http://www.play-scratchcards.co.uk
    Informationen und Berichte über Online Rubbellose.
    http://www.rubbellose-spielen.org

  10. #10
    krasloten24's Avatar
    krasloten24 is offline Private Member
    Join Date
    July 2009
    Posts
    67
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    All of the .HTACCES codes doesn't work, maybe it is becaush of the standard code Joomla has implemented in there .HTACCES files.

    The only thing I can do what will work is mention all the url's and redirected them manually with .HTACCES like Pokerworkx said. But it is a lot of work :P
    Informatie en reviews over online krasloten.
    http://www.krasloten24.nl
    Information and reviews about online scratch cards.
    http://www.play-scratchcards.co.uk
    Informationen und Berichte über Online Rubbellose.
    http://www.rubbellose-spielen.org

  11. #11
    tertip's Avatar
    tertip is offline Private Member
    Join Date
    August 2009
    Location
    Planet Earth
    Posts
    25
    Thanks
    21
    Thanked 6 Times in 6 Posts

    Default

    this works for me, try it maybe it helps

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

  12. #12
    casino2k.com's Avatar
    casino2k.com is offline Private Member
    Join Date
    January 2008
    Posts
    323
    Thanks
    118
    Thanked 61 Times in 47 Posts

    Default

    Quote Originally Posted by Schoonbeek View Post
    All of the .HTACCES codes doesn't work, maybe it is becaush of the standard code Joomla has implemented in there .HTACCES files.

    The only thing I can do what will work is mention all the url's and redirected them manually with .HTACCES like Pokerworkx said. But it is a lot of work :P

    This should work: open joomla .htaccess and put these two lines
    Code:
    RewriteCond %{HTTP_HOST} ^domain\.com
    rewriterule (.*) http://www.domain.com/$1 [R=301,L]
    after
    Code:
    RewriteEngine On
    RewriteBase /
    If it doesn't, please tell us what is the error message.
    Casino2k dot com

  13. The Following User Says Thank You to casino2k.com For This Useful Post:


  14. #13
    krasloten24's Avatar
    krasloten24 is offline Private Member
    Join Date
    July 2009
    Posts
    67
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    Awesome thanks it works, I forget to place it after after

    RewriteEngine On
    RewriteBase /



    Quote Originally Posted by casino2k.com View Post
    This should work: open joomla .htaccess and put these two lines
    Code:
    RewriteCond %{HTTP_HOST} ^domain\.com
    rewriterule (.*) http://www.domain.com/$1 [R=301,L]
    after
    Code:
    RewriteEngine On
    RewriteBase /
    If it doesn't, please tell us what is the error message.
    Last edited by krasloten24; 29 October 2009 at 11:28 am.
    Informatie en reviews over online krasloten.
    http://www.krasloten24.nl
    Information and reviews about online scratch cards.
    http://www.play-scratchcards.co.uk
    Informationen und Berichte über Online Rubbellose.
    http://www.rubbellose-spielen.org

Posting Permissions

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