Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-13-2012, 08:16 AM   PM User | #1
docock
Regular Coder

 
Join Date: Feb 2007
Posts: 197
Thanks: 21
Thanked 1 Time in 1 Post
docock is an unknown quantity at this point
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?
docock is offline   Reply With Quote
Old 09-27-2012, 09:00 AM   PM User | #2
webmiral
New Coder

 
Join Date: Sep 2012
Posts: 12
Thanks: 0
Thanked 2 Times in 2 Posts
webmiral is an unknown quantity at this point
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>
webmiral is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:09 PM.


Advertisement
Log in to turn off these ads.