PDA

View Full Version : Link to Raw IP Address



cooper44
01-13-2007, 04:23 PM
Here is an unusual question. How do I link to the raw IP address of my server? for instance: http://111.111.111.111/file?

I have a situation where I don't want individuals to know I own a URL.

Thanks,

Early Out
01-13-2007, 04:31 PM
Since these are shared servers, you've got a problem, there. The IP address for your box is the same as the IP address for about 950 other domains.

But, it will work (sort of) with a tilde and your BH username appended. So, if the IP for your box is 70.103.189.92, you can provide them with http://70.103.189.92/~yourname. However, any relative links on your home page will not resolve properly, which makes a hash of most pages, so try it before you give out the address.

cooper44
01-13-2007, 04:48 PM
Thanks Early!!

That works and is just what I needed.

thecolor
01-07-2008, 06:15 PM
Perhaps Early Out can assist with relative paths across domains. (live chat could not seem to figure it out) :(

I have several domains with bluehost, I also have several dirs in the public_html root dir in addition to addon and subdomain dirs.

I'd like to use relative backups ../ to obtain files in the root public_html from other domain directories.

ex. TREE:

public_html > ajax

public_html > domain1
public_html > domain2

I'd like to be able to link to a file from
public_html > domain1 to public_html > ajax using ../ (which is a standard html backup link).

Unfortunately, it seems only my main domain can do this, not addon domains. Is there a way to use relative links from addon domains back into the public_html dir? (not absolute)

Hope that makes sense. :)

TIA

Early Out
01-07-2008, 06:31 PM
I don't think you can get there from here. The whole notion of addon domains is that, despite where their files are stored, they appear to be completely separate domains. So, relative links aren't going to fly, any more than you could make a relative link from one of your domains to www.cnn.com.

Basil
01-07-2008, 06:39 PM
Can't be done without making an alias for the folder.

The browser handles relative links like this:
(Assuming "example.com" is the domain, and "folder" is the current folder)
/ => example.com/* (relative to root)
./ => example.com/folder/* (relative to folder)
../ => example.com/* (relative to folder)
../../ => cannot be resolved, there are no directories above example.com

What you can do is make a subfolder point to another folder on the server, you can also just as easily copy those files under the addon domain.

Example for making a symbolic link..

<?php
$target = "/home/bhuser/public_html/etc/"; //target of the link, bhuser is your username
$link = "linky"; //what to call the link

echo '<pre>';
if(!file_exists($link) && is_dir($target)) {
symlink($target,$link);
echo '<a href="'.$link.'">Shortcut</a> to "'.$target.'" created successfully';
} else {
if(file_exists($link)) echo "<a href='".$link."'>".$link."</a> already exists\n";
if(!is_dir($target)) echo "<u>".$target."</u> is not a valid directory";
}
echo '</pre>';
?>