1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Redirect every page like http:// to http://www.

Discussion in 'Apache' started by ShReYaS, Mar 28, 2010.

  1. #1
    I need a code to work this... i've googled and tried all the top .htaccess codes...

    and it ended up refreshing the page 5-6 times and firefox says redirection error..
    Please give an exact code for this
     
    ShReYaS, Mar 28, 2010 IP
  2. buggyB

    buggyB Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This code works just fine for me. It redirects domain.com/folder to www.domain.com/folder (forgive me, I can't post http:// links)

    Options +FollowSymLinks 
    RewriteEngine on 
    RewriteCond %{HTTP_HOST} ^yoursite.com [NC] 
    RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301] 
    
    Code (markup):
     
    buggyB, Mar 28, 2010 IP
  3. everypcneed

    everypcneed Peon

    Messages:
    238
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is slightly different then the one above but works for all pages on my site. I bolded the difference.

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^yoursite\.com$ [NC]
    RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
     
    everypcneed, Mar 29, 2010 IP
  4. ShReYaS

    ShReYaS Peon

    Messages:
    1,945
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    0
    #4
    will these work for wordpress blogs too??
     
    ShReYaS, Mar 29, 2010 IP
  5. everypcneed

    everypcneed Peon

    Messages:
    238
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I am not positive if Word Press has this option built in or not. But yes will work for any site. Simply add this code to the .htaccess file which is located in the root directory of your website. Usually named the public_html folder.
     
    everypcneed, Mar 29, 2010 IP