Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
OT - A bit of html code help please?
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 01/05/04 07:43 
Hi
Because I have only a relatively small number of bands on my JR site, and because the 'nice band names' feature on my server isn't working (not criticing Sully - I know you're working on it Very Happy ), I want to set up a folder for each band, with a simple index file in each one to redirect browsers to the appropriate JR site ie.- someone accessing www.mysite.co.uk/BandName (or even www.BandName.mysite.co.uk if possible?) will be seamlessly redirected to www.mysite.co.uk/jamroom/bands/X.
Can this be done? Does anyone have any sample html or php to do this?
Many Thanks
Pash


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 01/05/04 09:38 

pasher:
Hi
Because I have only a relatively small number of bands on my JR site, and because the 'nice band names' feature on my server isn't working (not criticing Sully - I know you're working on it Very Happy ), I want to set up a folder for each band, with a simple index file in each one to redirect browsers to the appropriate JR site ie.- someone accessing www.mysite.co.uk/BandName (or even www.BandName.mysite.co.uk if possible?) will be seamlessly redirected to www.mysite.co.uk/jamroom/bands/X.
Can this be done? Does anyone have any sample html or php to do this?
Many Thanks
Pash


Pash - put this in the index file:


Code

<html>
<head>
<meta http-equiv="refresh" content="0;url=http://yoursite.com/bands/1">
</head>
<body>
</body>
</html>


replace the "yoursite.com/bands/1" with the URL you want.

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 01/05/04 15:51 
Thanks Brian
That does the trick Very Happy
Pash


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
cabaz777



Joined: 08 Sep 2003
Posts: 147

Posted: 01/05/04 21:47 
Here is a full code for those who can setup wildcards DNS in their servers:


Code

<?


#####################################################################

#  YOU MUST EDIT THE FOLLOWING VARIABLES:

#####################################################################


# Your domain name WITHOUT the "www." NO TRAILING SLASHES ("/")
# Just the actual domain name: "yourdomain.com"

$domain = "YOURDOMAIN.com";


# The relative path to your users directory, ex:
# if your users directory is installed in yourdomain.com/users you
# should enter only $userdir = "users";

$userdir = "users";


# The default page that the visitors should be redirected to if
# they don't request a subdomain or they request a non-existing
# subdomain. This page should be your main index page. You can
# simply rename your existing index.html file to main.html This
# index.php file must be the default file that users are first
# directed on your site, so you must remove any other index.html or
# index.xxx file that may conflict. The main.html page should be
# located in your document root:"http://yourdomain.com/main.html"

$default_page = "main.html";


# Do you want to use frames?

$use_frames = "yes";






#####################################################################

#  CONFIGURATION COMPLETE... DO NOT EDIT ANYTHING BELOW HERE

#####################################################################

$sub = $HTTP_HOST;
$sub = eregi_replace("\.".$domain, "", $sub);
$sub = eregi_replace("www\.", "", $sub);
$sub = strtolower($sub);
if (is_dir("$DOCUMENT_ROOT/$userdir/$sub")) {
   if ($use_frames == "yes") {
      echo "<html><head><title>$sub</title>\n";
      echo "</head>\n";
      echo "<frameset cols=100%,* frameborder=no border=0 framespacing=0>\n";
      echo "<frame src=http://$domain/$userdir/$sub>\n";
      echo "<noframes>\n";
      echo "<body bgcolor=#FFFFFF>\n";
      echo "<br><br><font face=verdana size=2><center>\n";
      echo "This page uses frames, but it seems that your browser does not support this feature.\n";
      echo "<br><br>To move on, click here: <a href=http://$domain/$userdir/$sub>$sub.$domain</a>\n";
      echo "</center></font>\n";
      echo "</body>\n";
      echo "</noframes>\n";
      echo "</frameset></html>\n";
   }
   else {
      header("Location: http://$domain/$userdir/$sub");
   }
}
else {
   if (!$REQUEST_URI || $REQUEST_URI == "/") {
      header("$DOCUMENT_ROOT/$default_page");
   }
   else {
      header("Location: http://$domain$REQUEST_URI");
   }
}
?>


Pash: It may help you to have wwwband.yoursite.com instead by uploading it as the index.php file, pointing the folder to the one Brian shown before here.

BTW, may be it helps Brian to setup a subdomain feature for JR.
Hope it helps

Back to top
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 01/06/04 07:29 
Hi Cabaz
If I can just be clear on this before I try anything -

If I put your code (with the variables set accordingly) as my index.php, and then what do I put in the User folder? - all the 'bandname.html's, or 'bandname/index.html's? And presumably these html files each contain Brian's redirection code?

And this would allow domain names like 'www.bandname.mysite.co.uk'?

Also

Quote:
Here is a full code for those who can setup wildcards DNS in their servers:

Is this something I need to check on first?

Thanks
Pash


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
cabaz777



Joined: 08 Sep 2003
Posts: 147

Posted: 01/06/04 07:41 
Hi
Im not the best with servers and php, but this one works like this:

First you need to have wildcards DNS in your server, to check it type something like
http://xyz.yourdomain.com
if you get a default server page it have them, if you get an error page it not.
They can be setup from the server (Im using Plesk) by adding a DNS record like
*.yourdomain.com - A - 123.123.123.123 (server IP)

Or ask your hosting to know if they can setup for you.

Then, copy the code and save it as index.php and upload to your root (it must be the default page for the website)

Create a folder named "users" or what you want (users is the default one in the code I sent you)
Then add there subfolders like "myband" , "hisband", "herband" and so on. Each folder should have a index.html or php file containing the Brian´s redirection he sent you

Finally, you will able to reach the band website created by JR in the foll format:
http://myband.yourdomain.com directly from the browser.
If no folder exists with the subdomain asked i.e. http://xyz.yourdomain.com then the default main page will load showing yourdomain main page

that´s it.
hope it helps

Back to top
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 01/06/04 08:48 
Hi Cabaz
Thanks for that - fully understand how to do it now, but I've fallen at the first fence, so to speak - 'xyz.motagator.co.uk' cannot be found.
Hey Sully (mine host), is this something that can be done, or is it all still tied up with the 'nice band names' problem?
Cheers
Pash


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
cabaz777



Joined: 08 Sep 2003
Posts: 147

Posted: 01/06/04 09:11 
there is no other way then setup "wildcards DNS" in your server, or it will not recognize the subdomain.

you should need to contact your hosting to setup them, if they allow them, in case you dont have a dedicated boxand running JR in a shared one

Back to top
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 01/06/04 09:35 
I'm running JR on a shared box, so it all may not be possible - I'll ask my host anyway.
But it is all working now as 'www.motagator.co.uk/bandname' which is fine for the moment.
In fact, over the years, I've noticed that when you tell people, or even write down for them domain names like 'bandname.motagator.co.uk', they'll still put the 'www' in, then complain that it didn't work (such is the www ingrained in web culture) Crying or Very sad
So how it works now is arguably better in the long run, but this way could still be an interesting option to have.
Cheers
Pash


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
cabaz777



Joined: 08 Sep 2003
Posts: 147

Posted: 01/06/04 09:47 
this code works fine with the www too.
I used it for years in my other website and it can be reached as
http://www.user.mydomain.com or http://user.mydomain.com in the same way

keep the code somewhere in your PC, as it may help u in the future

Back to top
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 01/06/04 12:41 

Quote:
keep the code somewhere in your PC, as it may help u in the future

Will Do
Thanks for your help Cabaz
Pa


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
DS_Sultan



Joined: 01 Aug 2003
Posts: 103

Posted: 01/07/04 15:38 
Pasher, you already have subdomain capabilities with your hosting package. You can easily just set up myband.motagator.co.uk and have it point to their jamroom folder.

I have set up a sample config to show you just exactly what I mean.

Try going to http://collab.artistcollaboration.com and see what you get. That points a subdomain right to a jamroom users band site. This actually points to jamroom/bands/X but the user never knows that.

It's easy to set up and it's included with your package.

Let me know what you think of that.

Back to top
DS_Sultan



Joined: 01 Aug 2003
Posts: 103

Posted: 01/08/04 11:47 
***** Update ******

I fixed the issue! It was a deep linking issue Pasher. I added mccajun to the allowed list in the settings.cfg.php file and now it all works!

Check it out and let me know what you think. Then we can go over what to do if you don't already figger it out.

Sully!

******************************************


OK, Time for the 'Big Guy' to get involved. I have working examples of two sites that work fine with the images as follows:

collab.artistcollaboration.com
ibob.internetbattleofthebands.com

the one that does not work is Pashers at

mccajun.motagator.co.uk

Everything works for me on the two listed sites, images and all.

But the images don't work for Pasher, and neither does the songs or viewing of information. Now, it should look like the site at http://www.motagator.co.uk/jamroom/bands/1/index.php.

If you look at the both of the pics by right clicking to get their location they have exactly the same file info and path info, cept the sub domain one does not work.

My question is this Brian, all three of these sites are on the same box, and therfore it can't be a server issue. All three sites are running the exact same level of code (JR v2.0b3), and therfore have the same level of SQL datebases.

The only thing I can think of in this case Brian is that there is a second level domain name being dealt with here (i.e. motagator.co.uk) and the others are first level domain names. (i.e. artistcollaboration.com) Does your code parse or do anything with the domain name or explicit path? I don't think so, but I am at a loss to understand how the software won't see the images but will see the other info, of course, the rest of the info is now in the SQL DB if I am not mistaken.

So what is it about the images that is so unique in this case??? Is this a case of deep linking not working???

Drizzle Drazzle Druzzle Drone.... Time For Zeez One To Come Home....

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 01/08/04 12:12 

DS_Sultan:

The only thing I can think of in this case Brian is that there is a second level domain name being dealt with here (i.e. motagator.co.uk) and the others are first level domain names. (i.e. artistcollaboration.com) Does your code parse or do anything with the domain name or explicit path? I don't think so, but I am at a loss to understand how the software won't see the images but will see the other info, of course, the rest of the info is now in the SQL DB if I am not mistaken.


Since Jamroom gets the URL of the site it is running on from PHP, PHP can be "confused" in trying to get the REAL url, based on settings in the php.ini. You can overide the settings Jamroom uses, by modifying the jamroom/config/settings.cfg.php file, and changing the top two settings from "detect" to the actul path and URL to jamroom. So for example, lets say your jamroom site is in /home/pasher/public_html/jamroom, and the URL is "http://www.motagator.co.uk/jamroom". You would modify the settings file to look like this:


Code

#-----------------------------------------------------------------------
# PATH SETTINGS
#-----------------------------------------------------------------------
# Jamroom will try to auto-detect the path that it's scripts are running
# in, but on some servers this may not work 100% of the time.  Leave
# this at the default unless Jamroom tells you to change it.  Default is
# "detect" - any other value and Jamroom will attempt to use it as the
# ABSOLUTE path to the jamroom scripts.  Note that this must be the
# absolute path - i.e. /full/path/to/jamroom (note no trailing slash)
$config['jamroom_path'] = '/home/pasher/public_html/jamroom';

# if the $config['jamroom_path'] setting has been set to something OTHER
# then detect you must enter the URL for Jamroom here as well so Jamroom
# knows how to resolve relative URLS within its scripts.  Leave this at
# the default "detect" unless you have modifed the value above this one.
# if you do need to put an entry in, put it in like so:
# http://path/to/jamroom - note there is no trailing slash "/".
$config['jamroom_url'] = "http://www.motagator.co.uk/jamroom";


This will make it so Jamroom does not have to "figure out" where its at every time, and will always use the path and URL given in the config file.

See if that fixes the issues.

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
DS_Sultan



Joined: 01 Aug 2003
Posts: 103

Posted: 01/08/04 12:16 
Nope Brian, read my edited post above. Deep linking was the issue. Added the subdomain and all is good.

Sully.

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

12Next >
 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.