Jump to content

Dragen

Members
  • Posts

    1,154
  • Joined

  • Last visited

    Never

About Dragen

  • Birthday 05/22/1988

Contact Methods

  • Website URL
    http://www.gimppro.co.uk/

Profile Information

  • Gender
    Male
  • Location
    UK

Dragen's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Hi, I have a sub-domain set up, which links to a folder in the root directory of my main domain: main_root/sub_domain/ What I am trying (and failing) to do is to create a .htaccess entry in the root directory of the main domain (main_root), where the main domain website is, to stop users accessing the sub-domain via the relative path (ie; mydomain.com/sub_domain/) and instead only allowing access if they access it like so; sub_domain.mydomain.com Is this possible? I would preferably send them a 404 not found, rather than 403 or anything else. At the moment I have resorted to detecting the host, from within a .htaccess file in the sub-directory and if it is that of the main domain, then re-direct to the index page of the main domain, but I really need to be able to do this without editing the .htaccess of the sub-domain. Just for reference, the code I'm using in my sub-domain is as follows: RewriteCond %{HTTP_HOST} !^(www.)?sub_domain.maindomain.com [NC] RewriteRule ^(.*)$ / [R,L] Any help would be more than appreciated! Thanks.
  2. Does anyone have an answer for this? I need to be able to use getimagesize on he php script that outputs the image, without having to use a direct url. Thanks.
  3. Sorry, but your response didn't make much sense... What do you mean by: Also, the images are just stored in a folder in the root directory. The script just reads the images, scales them down and outputs them in the page. It doesn't save the thumbnailed image anywhere. Thanks.
  4. Okay, an update. After finding this forum topic on stack overflow: http://stackoverflow.com/questions/2430478/php-problem-with-getimagesize I tried using the full url: http://www.mydomain.com/incudes/resize.php?width=50&height=70&img=logo.jpg And it works. I'm not sure quite why this makes a difference, but is there any way around it? I quite need to be able to use relative paths. Regards.
  5. Hi, It's been a while since I've been on here... I've got a script that takes an image url and resizes it, then outputs it to the screen (using image headers etc). I've then got a htaccess file that changes my nice url, such as: 'images/thumb/50-70/logo.jpg' to: 'incudes/resize.php?width=50&height=70&img=logo.jpg' Which is the resize script, so I can use a nice url in img tags. The width and height are just the maximum allowed, so sometime the image will be smaller. Now, this all works correctly, but I am now trying to find out the width and height of the thumbnailed image, from outside of the resize.php script. I thought that I could use getimagesize, but this doesn't seem to work... I first tried it using the 'nice' url: '/images/thumb/50-70/logo.jpg' Thinking that .htaccess would re-direct, but no. I then tried a direct link to the resize file: '/incudes/resize.php?width=50&height=70&img=logo.jpg' But that returns a file not found error... Although I can access the file directly. Trying the direct url without the get variables, however, successfully finds the file, but it doesn't seem to be able to detect the image dimensions. I just get a blank result.. Is PHP able to recognise htaccess re-directs? Is PHP able to parse a php file that outputs as an image? (I have all the correct headers etc set!) Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.