Access store.domain.com ONLY from main domain: www.domain.co

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Access store.domain.com ONLY from main domain: www.domain.co

Postby gilbertv » 31. January 2009 18:33

I have a question regarding the system I plan to set up.

Webserver = Apache (Xampp V1.70)
Database = MySQL 5.0
CubeCart V4.2.0

1. I would like for all visitors/customers to only be able to access the store subdomain store.domain.com from the main domain http://www.domain.com. Not sure how to setup in apache of that's where I need to... So if anyone tries to access store.domain.com then they should not be able to if they are not referred from the main http://www.domain.com.


Any help is greatly appreciated
gilbertv
 
Posts: 15
Joined: 17. February 2007 22:28

Re: Access store.domain.com ONLY from main domain: www.domain.co

Postby Izzy » 31. January 2009 23:10

Perhaps install XAMPP and your script first and then I/we can then instruct you how to do what you want.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Access store.domain.com ONLY from main domain: www.domain.co

Postby gilbertv » 01. February 2009 01:06

Ok, I installed apache, mysql, cubecart etc etc successfully... everything seems to work normally.

note: did find some info on mod_access here: http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html

Is this the type of info that I should be looking for or is there a better method?

Thank you.
gilbertv
 
Posts: 15
Joined: 17. February 2007 22:28

Re: Access store.domain.com ONLY from main domain: www.domain.co

Postby Izzy » 01. February 2009 01:30

You can use an Alias or a VirtualHost or a .htaccess file containing a mod_rewrite rule.

The Above will enable you to keep your XAMPP defaults intact which is recommended.

If you read and search on those 3 then you should start to see some light at the end of the tunnel.

Have a go and then post back if you reach another obstacle in your path.

Edit
Just to add that there are some other options including at your domain name registrar - you can redirect domain.com to sub.domain.com

If your shop will be on a SSL (https://) then this will also have to be taken into account.

DynDNS has some info and is a possible solution:
http://www.dyndns.com/support/kb/webhop ... tions.html

Some help here with rewrite redirect in a .htaccess file and more.
http://www.webhostingtalk.com/showthread.php?p=3932702

This Google
has a plethora of good info on your issue.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Access store.domain.com ONLY from main domain: www.domain.co

Postby gilbertv » 01. February 2009 15:56

Hi Izzy, thank you for your help.

I am researching everything you gave me and although it is all very new to me, I am sure I will be able to make the website work just fine. Just takes time I guess. Also I don't think I fully explained how I would like this to work.

I do want visitors to go to the main domain: http://www.domain.com where there will be a couple of pages served. I don't want them redirected right away. I have in fact setup a referrer to another page as you suggested, both at the DNS server and using a referrer in .htaccess for other websites.

However, the subdomains http://store.domain.com and https://store.domain.com should only be accessed from the main domain http://www.domain.com. So the only referrer page/domain acceptable to http://store.domain.com and https://store.domain.com is the main domain http://www.domain.com.

So if anyone tries to access the "Store" from another webpage, or directly by entering a URL etc, they will not be able to.

Hopefully I will also be able to setup something in .htaccess at http(s)://store.domain.com to "force" the visitor to visit the main domain http://www.domain.com and start from there first. Then they can come back to the "Store" but only when clicking a link at the main domain, www.domain.com

Basically I need to be able to control the traffic.

URL ----> http://www.domain.com (pages served) ----> Links to Store ----> http(s)://store.domain.com

URL ----> http(s)://store.domain.com ----> No Direct Access Allowed!!-> Sent to ----> http://www.domain.com

I hope I was able to clarify that a bit more.
gilbertv
 
Posts: 15
Joined: 17. February 2007 22:28


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 112 guests