How rewrite link to subdomain

Discussion in 'Apache' started by bartns, Aug 23, 2010.

  1. #1
    Hi all!
    Is it at all posible and how? I managed to find some posts on link to subdomain rewrite but it doesnt work for me. I'm new in this and what I want to achieve is to rewrite link:

    http://mydomain.com/index.php?album=john/frederick into subdomain into
    http://frederick.mydomain.com

    Any help, please. Thanks
    PS Wildcards are turned on
     
    bartns, Aug 23, 2010 IP
  2. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #2
    
    RewriteEngine On
    RewriteCond %{QUERY_STRING} ^album=john/frederick$
    RewriteRule (.*) http://frederick.mydomain.com/$1? [R=301]
    
    Code (markup):
     
    tolra, Aug 23, 2010 IP
  3. bartns

    bartns Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Grete, works like a charm, except my hosting provider doesn't allow wild cards and provides only sub domain redirection. Any suggestions about that?

    Thanks anyway, again
     
    bartns, Aug 23, 2010 IP
  4. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #4
    If they don't allow wild cards and you need that functionality your only option is to swap hosts, there's enough of us about that you should be able to find one that matches your requirements. Any host offering cPanel should be able to accommodate you but if in doubt ask them first.
     
    tolra, Aug 23, 2010 IP
  5. bartns

    bartns Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for help and advice. Appreciate that.
     
    bartns, Aug 23, 2010 IP