Web Hosting Forum | Lunarpages

Author Topic: IP address VS domain name in link  (Read 14139 times)

Offline robertoodle2

  • Newbie
  • *
  • Posts: 3
    • RFP-Leads Culture & Attractions
IP address VS domain name in link
« on: January 01, 2010, 11:06:10 AM »

I want to use an IP address rather than a domain name in links.

This is one link that now exists --

http://www.rfp-leads.com/rlc/tpCompany.php  (truncated for simplicity)

This is what I want to use --

http://64.50.166.245/rfp-leads/rlc/tpCompany.php

The above does not work.
I have tried many variations but I have had no success.

Compounding the problem, "rfp-leads" is a sub-domain.

I will try any ideas you may have.

Sincerely,
Robert

Offline Mitch

  • Berserker Poster
  • *****
  • Posts: 12641
    • MitchKeeler.com
Re: IP address VS domain name in link
« Reply #1 on: January 01, 2010, 11:27:32 AM »
Could I ask why you need to do this?  It might be possible with a dedicated IP for the main hosting address, but seems like an odd request.
New to Web Site Hosting? Check Out the Lunarpages Blog Hosting Guide!


Follow us @lunarpages on Twitter!
Important Threads: Read This Before Posting! | Lunarforums Rules! | Mitch's Link of the Day!
Also, be sure to check out and subscribe to the Lunartics Blog and the Lunarpages Newsletter !

Need Web Hosting Help? Check out the Lunarpages Web Hosting Wiki. It has tons of tips, tutorials and resources!

bryantrv

  • Guest
Re: IP address VS domain name in link
« Reply #2 on: January 01, 2010, 12:28:50 PM »
I'm like Mitch, but you can do it though you have to use your username, which really isn't a great idea.
The address would be http://64.50.166.245/~username/rfp-leads/rlc/tpCompany.php
This is assuming you are on a standard shared plan.

Offline robertoodle2

  • Newbie
  • *
  • Posts: 3
    • RFP-Leads Culture & Attractions
Re: IP address VS domain name in link
« Reply #3 on: January 01, 2010, 07:19:48 PM »
Thank you for the replies.

Mitch,
"Could I ask why you need to do this?  It might be possible with a dedicated IP for the main hosting address..."

I have 2 dedicated servers.

Server A is in "production". It responds as expected to "www.rfp-leads.com"

Server B is a copy of server A.  I hoped to test the code on server B.
If I use the domain name in a link, it executes server A as expected.
I had hoped to use the IP address of server B to execute the code on server B.
---

bryantrv,

"The address would be http://64.50.166.245/~username/rfp-leads/rlc/tpCompany.php"

I did try several variations of this.
Since I know the "production" server A does work, I tried to execute it using its IP address.
---

I tried
http://64.50.166.245/~<edited>

This does execute OK, but it executes the "main" code at /public_html/index.php
I want to execute the code at /public_html/rfp-leads/rld/index.php
---

I tried
http://64.50.166.245/~<edited>/rfp-leads/

But I got a blank page.
I know I return a blank page if I am suspicious about the input.
I will investigate this.
---

I tried
http://64.50.166.245/~<edited>/rfp-leads/rld/index.php

I got
404 Not Found
The server can not find the requested page:
64.50.166.245/~<edited>/rfp-leads/rld/rld/inde9.php?framesetDate=20090807 (port 80)

Again I know my code has been triggered because
"?framesetDate=20090807" was added to the link -- this I recognize.

Also I see the subdirectory "rld/rld" has been duplicated -- probably by me.
---

Eventually, if an IP address works, I will program the IP into my <base statement.
That statement now contains
<base href="http://www.rfp-leads.com/rld/" />
which points to the current version subdirectory.
---

Perhaps it would be easier if I just used a slightly different domain name on server B.
---

Thank you for your replies.
I will work on this.
I will report back.

Robert

<Edited to remove Usernames, not recommended to post in forums ~Troy>
« Last Edit: January 02, 2010, 02:21:05 AM by Troy L »

darkwolf

  • Guest
Re: IP address VS domain name in link
« Reply #4 on: January 02, 2010, 02:24:08 AM »
This may take configuration on the server to allow the IP address to point to the correct location, and you may want to contact  support (support@lunarpages.com (email) or support.lunarpages.com (web) describing exactly what you want to be able to do, and include the last 4 digits of the card on record (for ownership verification) , the account username of the account in question, and the url for this forum.


bryantrv

  • Guest
Re: IP address VS domain name in link
« Reply #5 on: January 02, 2010, 04:32:13 AM »
Another thought- if you are running a name server on the backup server, you should be able to "hard wire" your computer to look at the backup- that's how I do it.
I'm not sure about Windows, but on Linux I simply add the line to my /etc/hosts file, and comment it out when I don't need it.

Offline perestrelka

  • Master Jedi
  • *****
  • Posts: 1397
Re: IP address VS domain name in link
« Reply #6 on: January 06, 2010, 06:09:56 AM »

The hosts file is also available in Windows under %SystemRoot%\system32\drivers\etc\. Howerver, I would recommend not using IPs in the urls as this can create confusions. I would simply create a subdomain something like dev.rfp-leads.com, pointed it to the dev server and do developing under account created with dev.rfp-leads.com domain.
Kind Regards,
Vlad Artamonov

Offline robertoodle2

  • Newbie
  • *
  • Posts: 3
    • RFP-Leads Culture & Attractions
Re: IP address VS domain name in link
« Reply #7 on: January 09, 2010, 01:39:04 PM »
All,

My error was in the HTML that I generate.
In particular the "<base ..." statement.

I was insisting on using the domain name instead of HTTP_HOST
even when HTTP_HOST was numeric.

Now I use HTTP_HOST in all cases. It is simpler code.

Now I can execute using
IP address
or
IP address/subdomain
or
IP address/subdomain/sub directory

---

Also, when uploading images, I use "realpath( ... ['DOCUMENT_ROOT'])"
to develop the path name for files.

When invoking the code using a domain name OF A SUBDOMAIN
DOCUMENT_ROOT contains the desired subdomain.

But when invoking the code using the IP address
DOCUMENT_ROOT does NOT contain the subdomain.

So when HTTP_HOST is numeric, I must add the subdomain to "real_path".

---

for some reason, I do not need to use ~username

Thanks for your replies,
Sincerely,
Robert

Offline sowmika

  • Newbie
  • *
  • Posts: 2
Re: IP address VS domain name in link
« Reply #8 on: May 03, 2010, 11:54:05 PM »
Hi,IP address and domain name are same,for this exact information,you can visit here http://www.whoisxy.com/ and check it with real date.also it provide an various Ip related informations. It is totally free site.

 

Share |