Subdomain redirect ,silent

Discussion in 'Apache' started by casper, Jan 18, 2006.

  1. #1
    Hi guys,

    I'm working on webhost similar to geocities or w/e, to keep it short. I would like my users to use a subdomain rather than the required url to enter the homepage, since its easier to remember.

    I've read a tutorial about htaccess, and I've set up a small bit which works quite well;

    It has two problems I still would like to fix:

    1. It will keep a backslash at the right of the $1 variable;
    http://john.mail-maniac.com/ will become http://www.mail-maniac.com/user.php?user=john/
    I would like to see it http://www.mail-maniac.com/user.php?user=john
    without the slash :)

    2. The tutorial only mentions a 301 redirect, and uses [L,R=301] to accomplish this. I would like a silent redirection, where the user doesn't see any difference in the location bar.

    Any help is appreciated!


    Caps
     
    casper, Jan 18, 2006 IP
  2. casper

    casper Guest

    Messages:
    181
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I found the solution to the slash problem; add a \ to escape it.
    This is weird; when I use this code

    Works fine, but it fails if you remove the bold part. How come?

    grz
     
    casper, Jan 18, 2006 IP