301 page to new sub domain, Should be simple but not working

Discussion in 'Apache' started by smokey99, Nov 12, 2011.

  1. #1
    Hi Everyone,
    I know this should be easy, but for some reason its not working for me :-(

    I want to redirect http://www.domain. com/newpage.htm
    to
    http://subdomain.domain. com/

    (I placed a space between . and com) for this thread


    Can someone please write an example for me?
    Thank you so much
    Smokey
     
    smokey99, Nov 12, 2011 IP
  2. 2WDH.com

    2WDH.com Active Member

    Messages:
    143
    Likes Received:
    3
    Best Answers:
    5
    Trophy Points:
    68
    #2
    Hi Smokey.
    1.
    Do you mean you have tried some solution that doesn't work for you?

    2. Did you try
    redirect 301 /newpage.htm http://subdomain.domain. com/
    in .htaccess?
     
    2WDH.com, Nov 12, 2011 IP
  3. smokey99

    smokey99 Well-Known Member

    Messages:
    475
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Hi 2WDH
    Thanks for your reply
    I have tried several possible .htaccess versions, none seem to create the desired effect.
    Yes one I tried was "redirect 301 /newpage.htm http://subdomain.domain. com/"

    Here is one I also tried
    
    Redirect 301 http://www.mightygrip.com/pole-dancing.htm http://www.mightygrip.com/pole-dancing.htm
    
    Code (markup):
    Thanks for any help you can provide
    Smokey

     
    smokey99, Nov 12, 2011 IP
  4. 2WDH.com

    2WDH.com Active Member

    Messages:
    143
    Likes Received:
    3
    Best Answers:
    5
    Trophy Points:
    68
    #4
    Probably that is not an exact code you have tried. Can you post the exact code?
     
    2WDH.com, Nov 12, 2011 IP
  5. smokey99

    smokey99 Well-Known Member

    Messages:
    475
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #5
    I have tried several, but here is the most recent effort.

    rewriteengine on
    rewritecond %{HTTP_HOST} ^mightygrip.com$
    rewriterule ^(.*)$ "http\:\/\/www\.mightygrip\.com\/$1" [R=301,L] #4e432a55b0589
    
    
    Redirect 301 /pole-dancing.htm http://mightygrip.com/pole-dancing.htm
    Code (markup):
     
    smokey99, Nov 12, 2011 IP
  6. smokey99

    smokey99 Well-Known Member

    Messages:
    475
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #6
    Dang I just noticed my error in looking at the code above, I was making a circle :-(
    Thanks 2WDH
     
    smokey99, Nov 12, 2011 IP
  7. 2WDH.com

    2WDH.com Active Member

    Messages:
    143
    Likes Received:
    3
    Best Answers:
    5
    Trophy Points:
    68
    #7
    Smokey,

    No problem. Does it work fine for you now?
     
    2WDH.com, Nov 12, 2011 IP
    smokey99 likes this.
  8. smokey99

    smokey99 Well-Known Member

    Messages:
    475
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #8
    It does 2WDH, thanks for your help. I guess I have been staring at my monitor for too many hours today.
    Have a great weekend
     
    smokey99, Nov 12, 2011 IP
  9. 2WDH.com

    2WDH.com Active Member

    Messages:
    143
    Likes Received:
    3
    Best Answers:
    5
    Trophy Points:
    68
    #9
    Thanks. Have a great weekend as well! :)
     
    2WDH.com, Nov 12, 2011 IP