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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2007
    Posts
    218
    Thanks
    25
    Thanked 1 Time in 1 Post

    subdomain same content

    I've got a domain (let's say www.shop.com) and a subdomain (for example test.shop.com).

    On www.shop.com is a normal webshop, and I want the same shop on my subdomain without having to copy all files to my subdomain.

    So when someone visits my subdomain he sees the same shop, but with the url of the subdomain.

    I know this can be done with a rewrite rule, but I don't know how

    Can someone help me?

  • #2
    New Coder
    Join Date
    Sep 2012
    Posts
    12
    Thanks
    0
    Thanked 2 Times in 2 Posts

    ServerAlias

    ServerAlias may be a solution for you. It is the more effective apache config method than rewrite rules. Your domain become faster if you do not use rewrite engine.

    Code:
    <VirtualHost *>
    ServerName www.shop.com
    ServerAlias *.shop.com
    #ServerAlias anotherdomain.com #optional
    #ServerAlias www.anotherexample.net # optional
    
    # and more config
    </VirtualHost>


  •  

    Posting Permissions

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