Author Topic: Help please - Sub-domain problem!  (Read 6812 times)

0 Members and 1 Guest are viewing this topic.

Offline cm

  • Newbie
  • *
  • Posts: 14
    • View Profile
Help please - Sub-domain problem!
« on: October 18, 2002, 03:16:43 PM »
Hi,

We recently introduced a sub-domain for our 4 images gallery, which is causing us some problems with broken images.

The normal URL, http://www.eforecourt.com/gallery works fine. However, using http://gallery.eforecourt.com means that the images come up broken.

I've tried changing 'SCRIPT_URL' in constants.php to define('SCRIPT_URL', 'http://gallery.eforecourt.com'); //no trailing slash, but that didn't appear to make any difference.

Any suggestions on how I can get it working with the sub-domain URL?

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Help please - Sub-domain problem!
« Reply #1 on: October 18, 2002, 03:33:58 PM »
sorry, but this is not a real sub domain, it's just a forwarding url.

have nothing with 4images to do..

try to set:
in SCRIPT_URL:
http://www.eforecourt.com/gallery
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline cm

  • Newbie
  • *
  • Posts: 14
    • View Profile
Help please - Sub-domain problem!
« Reply #2 on: October 18, 2002, 03:53:12 PM »
Quote from: Nicky
sorry, but this is not a real sub domain, it's just a forwarding url.

have nothing with 4images to do..

try to set:
in SCRIPT_URL:
http://www.eforecourt.com/gallery


Thansk Nicky for your reply.

Yes, you are right, it is an apache redirect directive that is being used. However, I do think that the problem itself resides with 4images. We've also applied the same principle to phpClassifieds and vBulletin, and both work fine.

The problem as I see it is that 4images references the image location as relative rather than absolute e.g. img src="./data/thumbnails/14/CNV00023_lg.jpg", and that doesn't work in conjunction with the subdomain redirect.

For example, in vBulletin images for the sub-domain are generated as http://forums.eforecourt.com/images, and with normal domain (ie /forums) as http://www.eforecourt.com/forums/images. This all happens automatically by vBulletin itself.

Any suggestions as to hoe this can also be accomplished in 4images?

Offline fanncy pants

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • http://www.backshots.us
CM, you're not alone!
« Reply #3 on: December 01, 2002, 02:00:32 PM »
I am so glad that I'm not the only one experiencing this problem!   I agree, this situation seems to stem from 4images script.  I've done just about everything "cm" has done to resolve the broken images problem on the subdomain URL to my gallery, and with the same results.  I hope a future 4images update can fix this bug.

Fanncy Pants!

[/color]

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
.
« Reply #4 on: December 01, 2002, 05:18:20 PM »
It's not a bug.  4images needs to use relative path names to be the most flexible to accomodate the needs of the majority of users.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Help please - Sub-domain problem!
« Reply #5 on: December 01, 2002, 05:50:58 PM »
I just tryed to do make 'sub-domain' or 'forwarding url'
I add to my apache config:
Code: [Select]
<VirtualHost *>
ServerAdmin webmaster@yourdomain.com
ServerName gallery.yourdomain.com
DocumentRoot c:/www/gallery
</VirtualHost>

or redirect URL:
Code: [Select]
<VirtualHost *>
ServerAdmin webmaster@yourdomain.com
ServerName gallery.yourdomain.com
Redirect / http://www.yourdomain.com/gallery
</VirtualHost>

and it works just perfectly.
or u talking about something else?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Close but not quite
« Reply #6 on: December 01, 2002, 07:13:41 PM »
I'm fairly certain these users don't have access to their Apache config file.  Instead they are probably using .htaccess to set this up or possibly even a cgi-bin file.

Sample .htaccess directory forwarding:
Code: [Select]
Redirect /news            http://mydomain.com/stories

Sample cgi-bin subdomain in something like index.cgi:
Code: [Select]
#!/usr/bin/perl

$url="";

if ($ENV{'HTTP_HOST'} =~ /(www\.|^)mail.mydomain.com/)
{$url = "http://$ENV{'HTTP_HOST'}/cgi-bin/webmail/webmail.pl"}

if ($ENV{'HTTP_HOST'} =~ /(www\.|^)search.mydomain.com/)
{$url = "http://$ENV{'HTTP_HOST'}/search.php"}

if($url eq "") {$url="http://mydomain.com/index.php"}

#################################################################
print "Location: $url\n";
print "Content-Type: text/html\n\n";
print "<HTML><HEAD><TITLE>$ENV{'HTTP_HOST'}</TITLE></HEAD><BODY>\n";
print "<A HREF=\"$url\">Click here to enter</A>\n";
print "</BODY></HTML>\n";

Offline mohab

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Help please - Sub-domain problem!
« Reply #7 on: May 04, 2006, 08:57:40 AM »
have the same problem with subdomians or forwarding
Chris could you explain the httpacces line more detailed.
Ther comes just an errror back form the server.

What iam loking to run

www.Mysite.com/marathon    whant to change to   marathon.mysite.com

thnak you