Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    67
    Thanks
    20
    Thanked 0 Times in 0 Posts

    .htaccess Rewrite

    I would like to use .htaccess whereas when a user visits subdomain.domain.com, they are automatically redirected to domain.com/subdomain (I've already set this up), but the address appearing in their address bar still says subdomain.domain.com.

    Thanks in advance.

  • #2
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts
    That'll be because you're doing a rewrite, not a redirect. Either change your rule to:

    Redirect {subdomain} {subdirectory}

    ...or add the directive [R=301] at the end of the rewrite rule.

  • Users who have thanked Pennimus for this post:

    coolcamo8642 (03-10-2008)

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    67
    Thanks
    20
    Thanked 0 Times in 0 Posts
    Thanks a lot, I've gotten it to work perfectly.


  •  

    Posting Permissions

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