SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Scary's On The Wall
    Join Date
    Apr 2003
    Location
    PA
    Posts
    518
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Subdomains and subfolders in conflict

    Hi all,

    I'm having a bit of a problem with my web site. I have a subdomain (rpg.mysite.com) that is an exact replica of the main site (www.mysite.com) with only a few minor changes, and using different database. They also use the exact same session names. Sessions from rpg.mysite.com are unique to sessions from www.mysite.com. However, if someone were to go to www.mysite.com/rpg/ the sessions would get mixed up. How do I prevent people from accessing www.mysite.com/rpg/? Or if you know any other solution to this problem (besides changing ALL of the session names in ALL of my scripts) that would be perfectly fine too. Thanks!

  2. #2
    Scary's On The Wall
    Join Date
    Apr 2003
    Location
    PA
    Posts
    518
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone?

  3. #3
    Scary's On The Wall
    Join Date
    Apr 2003
    Location
    PA
    Posts
    518
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let me rephrase this:

    I have http://www.mysite.com and http://rpg.mysite.com

    How do I prevent users from accessing http://www.mysite.com/rpg/ without messing up http://rpg.mysite.com?

  4. #4
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only way I can think of is to make a rewrite rule which redirects people to the subdomain if they try and access the folder on the www domain Not sure exactly how it would work though.

    Interesting point you bring up though - I guess the script should really have an easier way to change cookie config options like that.

  5. #5
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi :-),

    Quote Originally Posted by Haleden
    Let me rephrase this:

    I have http://www.mysite.com and http://rpg.mysite.com

    How do I prevent users from accessing http://www.mysite.com/rpg/ without messing up http://rpg.mysite.com?
    I'm supposing that you're running Apache and have .htaccess enabled.

    Create an .htaccess into rpg sub-dir as:

    /rpg/.htaccess
    Code:
    SetEnvIfNoCase Host ^rpg\.mysite\.com$ let_me_in
    
    <FilesMatch ^.*$>
    Order Deny,Allow
    Deny From All
    Allow From env=let_me_in
    </FilesMatch>
    doing that accesses are allowed only if the host is rpg.mysite.com,
    for others host such as mysite.com or www.mysite.com accesses are denied.


    Thanks,
    :-) Andrea
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  6. #6
    Scary's On The Wall
    Join Date
    Apr 2003
    Location
    PA
    Posts
    518
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much! I was beginning to worry that no one would answer me!

  7. #7
    SitePoint Enthusiast
    Join Date
    Jun 2003
    Location
    none
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm guessing that worked?


Bookmarks

Posting Permissions

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