Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 14 of 14

This is a discussion on multihosted domain problem in the Shared & Semi-Dedicated forum
I have a domain name multihosted on a subdomain of my main account. The problem is that if I type "http://mydomain.com/test" it changes the URL ...

  1. #1
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161

    multihosted domain problem

    I have a domain name multihosted on a subdomain of my main account. The problem is that if I type "http://mydomain.com/test" it changes the URL in the browser to "subdomain.mydomain.com/test", if I type "http://mydomain.com/test/" it stays the same like it should. Is this something I can fix or is it something support can fix. Here is the actual example:

    http://linux-programming.org/test - changes

    http://linux-programming.org/test/ - works fine

    Randy

  2. #2
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    This is funny... sort of.

    I had the EXACT same problem on Friday with a mutlihosted domain of mine, to go into the subdirectory... It took a couple of hours, but I got the proper rewrite rules for .htaccess.

    I also wanted to redirect anyone using the www to the domain without the www.

    For me the problem was a combination of the trailing slash issue and the lack of "www" as the third level domain. Looks like Jag's master .htaccess is improperly re-writing the trailing slash.
    I give you what I used, altered for your given case, with no warranty.

    Put it into the subdirectory "test"; chmod 644

    Code:
    RewriteCond %{HTTP_HOST}   ^www\.linux-programming\.org [NC]
    RewriteRule ^/(.*)         http://linux-programming.org/test/ [L,R]
    
    RewriteCond %{HTTP_HOST}   !^linux-programming\.org [NC]
    RewriteCond %{HTTP_HOST}   !^$
    RewriteCond %{REQUEST_URI} !^$
    RewriteRule ^(.*)         http://linux-programming.org/test/$1 [L,R]
    I was afraid to open a ticket on this outside of normal hours and heading into the weekend... but maybe we oughta open a ticket on Monday morning?

  3. #3
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Woo Hoo! That is soooo friggin' cool! Never noticed it before...

    JagPC must be is mapping the subdomains to the subdirectories using 'mod_rewrite', or whatever, and when the trailing slash is missing, it's making an external redirect using the already rewritten path.

    Interesting!

    Okay, here's what I did...

    My domain: Lenon.com
    Subdomains: alpha, beta, civic, download, pilot

    Code:
    #Add trailing slash to subdomain directory, if missing,
    #Then redirect to real server address - VinDSL(Lenon.com)
    RewriteCond %{HTTP_HOST} lenon\.com                               [NC]
    RewriteCond %{REQUEST_URI} /(alpha|beta|civic|download|pilot)/
    RewriteRule ^([^/]+)/(.*) http://$1.lenon.com/$2                  [R=301,L]
    Initial testing is positive. We'll see if it causes any problems. If so, I'll report back...

    In your case, I would try:

    Code:
    #Add trailing slash to subdomain directory, if missing,
    #Then redirect to real server address - VinDSL(Lenon.com)
    RewriteCond %{HTTP_HOST} linux-programming\.org                   [NC]
    RewriteCond %{REQUEST_URI} /test/
    RewriteRule ^([^/]+)/(.*) http://$1.linux-programming.org/$2      [R=301,L]
    So, you that gives you a couple of possible solutions. Have fun!

    EDIT: BTW, I should have mentioned, I put the above code in my ROOT '.htaccess' file...
    Last edited by Vin DSL; 04-11-2005 at 12:25 AM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Quote Originally Posted by Ron
    This is funny...
    Quote Originally Posted by Vin DSL
    Woo Hoo! That is soooo friggin' cool!
    LoL! Hey, Ron, I think we need to 'get a life'...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  5. #5
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Um...

    I edited the code above - got rid of the anchors in the 'HTTP_HOST' condition. Works much better now!

    Sorry for the confusion! I worked 26 hours yesterday...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  6. #6
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161
    If I put that code in the root directory will it effect all the subdirectories? If not I'd probably rather open a ticket and get this fixed to work correctly with any directory, I really don't want to the hassle of putting .htaccess in every directory that I make.

    Randy
    Last edited by randyriegel; 04-10-2005 at 10:13 PM.

  7. #7
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    If you're asking me, yeah, you should probably open a ticket. It's impossible to figure out what kind of 'magic' JagPC is using to accomplish this multi-hosting stuff.

    I'm a little fuzzy today, and not even sure I understand the question. The solution I'm playing around with works for my situation, but it might not work for you. Dittos for Ron's solution, although he's undoubtedly had more sleep than me...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  8. #8
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161
    I opened a ticket and they just got it fixed, 15 minutes after opening. I love the support here!

    Randy

  9. #9
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Yep! JagPC rocks!!!
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  10. #10
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    BTW, I want to thank YOU for posting your problem here...

    It always bugged me that someone could call up a subdomain by going directly to the subdomain directory. Search bots are particularily bad about this.

    For instance, I have various 'test' sites setting in subdomains, i.e. alpha, beta, pilot.

    Using 'pilot' as an example:

    The subdomain is 'pilot.lenon.com' but you could call it up using 'lenon.com/pilot' - kinda defeats the whole purpose of having a subdomain, no?

    Try it now:

    http://lenon.com/pilot
    http://lenon.com/pilot/
    http://lenon.com/pilot/modules.php?n...idth_Meter_DSL

    http://www.lenon.com/pilot
    http://www.lenon.com/pilot/
    http://www.lenon.com/pilot/modules.p...idth_Meter_DSL


    And, it doesn't affect other 'slashless' names:

    http://www.lenon.com/mail
    http://www.lenon.com/phpMyAdmin


    All is good!
    Last edited by Vin DSL; 04-11-2005 at 12:17 AM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  11. #11
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    I'm glad it worked out for you, but I wouldn't have opened such a ticket in the middle of the night, and if I were a webhost, I wouldn't want my techs making that kind of change without a serious review.

    Do you have any idea of how many websites might be negatively affected by changing that behavior? Maybe some are hard coded with that behavior in mind?

    So are you guys on the same server, or was Vin DSL referring to his personal .htaccess changes, or did they make this change complex-wide?

  12. #12
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Don't go postal on us, Ron...

    He's on Orion. I'm on Neutron. I was simply thanking him for bringing the situation to light. I fixed it, on my site, by adding code to my ROOT '.htaccess' file. I didn't mean to imply that 'Tech Support' made a global change.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  13. #13
    Wookiee JPC-Les's Avatar
    Join Date
    May 2002
    Location
    The Exogorths belly
    Posts
    1,265
    The original problem is common and can be easily fixed by submitting a ticket (or updating the original) and requesting the "servername" entry in the httpd.conf be changed from the subdomain to the multihosted domain.

    Although if you want to use the cool htaccess method that's fine too
    (pm) | (email) Les, Chief Operations Officer

    Need a Manager?
    (pm) | (email) David, Customer Service Manager
    (pm) | (email) Masood, Chief Technical Officer

    Helpful Links
    Knowledge Base | Network Status | Current Specials

  14. #14
    Aletia Customer
    Join Date
    Oct 2001
    Posts
    631
    Anyway this can be used to re-direct people to the actual domain, rather than just the subdomain?

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
  •