WordPress.org

Ready to get started?Download WordPress

Forums

WordPress URL Problem (22 posts)

  1. bigbass1997
    Member
    Posted 2 years ago #

    Ok so I have a major issue and I think I know what the problem is but not how to fix it. So my wordpress site is hosted off my own computer. Due to that, when I go to the site the page addresses always start off like this: http://localhost/wordpress/

    I have no problem looking at any part of the site but when ppl connect that arent on my network, their addresses also show up as http://localhost/wordpress/, which causes their browser to think that they are trying to access the site as if it was hosted on their computer.

    To fix this I thought that I could change the WordPress and Site address (URL) from "http://localhost/wordpress" to "http://bigbass1997.info.tm/wordpress". Once I changed that it no longer let me connect from my computer since it would try to take me to http://bigbass1997.info.tm/wordpress, which would cause it to send me to my modem control panel. This is due to the fact that my domain name is the same as my IP (duh) which is how I access my modem's config panel.

    I had to get my trusted friend to log on and change the URL's back to what they were. If someone has a fix to this please please tell me!

    -bigbass1997

  2. s_ha_dum
    Member
    Posted 2 years ago #

    ... which causes their browser to think that they are trying to access the site as if it was hosted on their computer.

    Yes. That is what 'localhost' means.

    Once I changed that it no longer let me connect from my computer since it would try to take me to http://bigbass1997.info.tm/wordpress, which would cause it to send me to my modem control panel.

    Of course it does. If you try to access a site on a public address you are going to connect to the public address over the internet, even if it is hosted on your computer. When you try to connect, if the address isn't 'me'-- aka, localhost or the equivalent-- you computer will connect to the internet and ask a name server for the IP matching that domain name.

    This is due to the fact that my domain name is the same as my IP (duh)

    No it isn't. Your IP address is a number, your domain name is not. Don't confuse the two. It will get you in trouble. The two are associated via the DNS registration system but they are not the same.

    Hosting a site like you are is dangerous. If someone hacks your site, they hack your computer-- email, credit cards, bank records, passwords, everything. But if you are going to do it you can try to adding an entry to your 'hosts' file. However, I am not sure if you will end up creating a weird loop by doing that, since your server will use the hosts file when connecting. In fact, I suspect that you will create problems but give it try. Its no fun until you start breaking stuff.

  3. bigbass1997
    Member
    Posted 2 years ago #

    When I said that my domain name is the same as my IP I ment that the domain redirects to my IP so its as if I was just typing in my IP. Also I know that it can be dangerous. I'm not an idiot with computers or the internet, but I don't know everything.

    Other than that you just told me just about everything I already knew. The link you gave me doesnt tell me anything useful. All it does is explain what the HOSTS file does, which I already knew.

    I was thinking that maybe I could add an IF statement somewhere that redirects ppl connecting from 127.0.0.1 to the localhost address and anyone else to the bigbass1997.info.tm address. But I dont know how I would do this if it was even possible.

    Anyone know a good way of fixing my problem?

  4. s_ha_dum
    Member
    Posted 2 years ago #

    When I said that my domain name is the same as my IP I ment that the domain redirects to my IP so its as if I was just typing in my IP.

    Then you should say what you mean, not what would be understood if people could read your mind.

    Other than that you just told me just about everything I already knew.

    Again, my apologies for not being able to read your mind.

    All it does is explain what the HOSTS file does, which I already knew.

    And again with the mind reading...

    You do realize that I don't know who are or what you know?

    You are trying to do something a little bit weird and I think your hosts file is one of your only options. Have you tried that?

    Can you disable WAN configuration on your modem? That is a good idea anyway but it may also prevent problem you were having with hitting that config interface instead of the site.

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    Have you forwarded the appropriate ports on your router?

    Connecting to localhost will take you to your router control panel, unless you forward your web ports to the appropriate computer on your network

  6. jbusci
    Member
    Posted 2 years ago #

    do you have a domain name registered?

    If you do, then you need to get a DNS service so that when someone looks up your domain name (types it in a browser) it resolved to your IP address.

    This is one I used back in the day, I think it's still free.

    http://www.zoneedit.com/

    Other than that, the only way someone is gonna access your computer remote is through your IP address. AND if you want to serve them pages, you have to be listening on the http port 80. This means you need to open your firewall on that port. Not a big deal.

  7. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    Not a big deal

    Right! As long as your ISP supports that, most don't... unless you've specifically bought commercial internet, you're probably violating their TOS. And as long as your network is isolated - you wouldn't wanna get hacked and lose everything connected to your network. And as long as you are a network security guru so you can secure that box.....

    So many things to consider. I ran a personal site off of an extra computer for a bit... once I learned a bit more, I closed off them ports and got rid of it. Waaay too much to consider.

  8. jbusci
    Member
    Posted 2 years ago #

    as long as your ISP supports what? opening port 80? They only thing your ISP can do is filter the port. If that is the case, you reroute the request with a dynamic dns service.

    someone who is developing a local web shouldn't need the hacking advice either.

    Anyways, this isn't really a WP issue, so w/e

  9. bigbass1997
    Member
    Posted 2 years ago #

    Yes I have a domain name registered (http://bigbass1997.info.tm/) and I have all the needed ports forwarded. (TCP Port 80)

    Also no matter what port you forward it wont fix my problem. When you forward a port on your modem/router, it only works for those outside your network. That is why there is such a thing as localhost, for anyone using the computer that is hosting the service. Please read my first post to understand my problem. It has nothing to do with my ports since ppl are able to connect to my site, just not the WP part of it.

  10. s_ha_dum
    Member
    Posted 2 years ago #

    as long as your ISP supports what? opening port 80? They only thing your ISP can do is filter the port. If that is the case, you reroute the request with a dynamic dns service.

    That is not all your ISP can do. DynamicDNS service or not, your ISP knows (if they care to) what kind of traffic is running on their network and can suspend or cancel the account. I am aware of this happening to a couple of different sites that were hosted on PCs at home. Again, whether they care enough to take action is another question.

  11. jbusci
    Member
    Posted 2 years ago #

    like I said, if your isp is going to complain about traffic on port 80, or block it, or threaten to cancel your service over port 80 traffic, then you route your traffic through a different port.

    What are they going to do block every port? lol

    btw,

    `"You also may not exceed the bandwidth usage limitations that Verizon may establish from time to time for the Service, or use the Service to host any type of server."'

    All those evil gamers out there violating TOS. lol

  12. bigbass1997
    Member
    Posted 2 years ago #

    OK i guess I will say it again. THE ISP IS NOT MY PROBLEM! So please just help me with the first problem. When I access my site through localhost it works fine but when others go to it, the site tries to make them use the localhost address instead of the domain name. I know that this a the problem because people are able to visit the rest of my site without a problem. The problem only happens on any part of the WordPress part of the site.

  13. jbusci
    Member
    Posted 2 years ago #

    bigbass, you need to make the url in wordpress be the real url and not the localhost url so that others can see your site and the links work properly from external.

    you need to figure out why your computer is resolving your real url to your router login page.

    sounds like bad host file or maybe bad port forwarding.

  14. bigbass1997
    Member
    Posted 2 years ago #

    I think the reason that when I change the WP URL to the real URL, that it doesnt work for me, is because it would be as if I typed in my IP into the address bar instead of the domain. Which is another way to access my modem configuration page.

  15. jbusci
    Member
    Posted 2 years ago #

    ok do this

    http://www.bobborst.com/tools/whatsmyip/

    what is the internal and external ip addresses you end up with?

  16. bigbass1997
    Member
    Posted 2 years ago #

    int. IP: 192.168.254.14
    ext. IP: 74.44.210.174

    The domain name points to the ext. IP and the port forward (port 80) points to my int. IP.

  17. jbusci
    Member
    Posted 2 years ago #

    hmmm...

    post the whole ipconfig /all command here please

  18. bigbass1997
    Member
    Posted 2 years ago #

    Windows IP Configuration

    Host Name . . . . . . . . . . . . : Luke-PC
    Primary Dns Suffix . . . . . . . :
    Node Type . . . . . . . . . . . . : Hybrid
    IP Routing Enabled. . . . . . . . : No
    WINS Proxy Enabled. . . . . . . . : No

    Ethernet adapter Local Area Connection 2:

    Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
    Physical Address. . . . . . . . . : 00-26-18-9B-85-3E
    DHCP Enabled. . . . . . . . . . . : Yes
    Autoconfiguration Enabled . . . . : Yes

    Ethernet adapter Local Area Connection:

    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Realtek PCI GBE Family Controller
    Physical Address. . . . . . . . . : 00-26-18-9B-83-FC
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes
    Link-local IPv6 Address . . . . . : fe80::6d79:4a11:7338:f441%10(Preferred)
    IPv4 Address. . . . . . . . . . . : 192.168.254.14(Preferred)
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . : 192.168.254.254
    DHCPv6 IAID . . . . . . . . . . . : 234890776
    DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-14-97-7B-83-00-26-18-9B-83-FC

    DNS Servers . . . . . . . . . . . : 192.168.254.254
    NetBIOS over Tcpip. . . . . . . . : Enabled

    Ethernet adapter Local Area Connection 3:

    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Hamachi Network Interface
    Physical Address. . . . . . . . . : 7A-79-05-5A-D3-59
    DHCP Enabled. . . . . . . . . . . : Yes
    Autoconfiguration Enabled . . . . : Yes
    Link-local IPv6 Address . . . . . : fe80::6df1:44d3:c639:f9ba%15(Preferred)
    IPv4 Address. . . . . . . . . . . : 5.90.211.89(Preferred)
    Subnet Mask . . . . . . . . . . . : 255.0.0.0
    Lease Obtained. . . . . . . . . . : Thursday, July 12, 2012 7:38:10 AM
    Lease Expires . . . . . . . . . . : Friday, July 12, 2013 7:39:33 AM
    Default Gateway . . . . . . . . . : 5.0.0.1
    DHCP Server . . . . . . . . . . . : 5.0.0.1
    DHCPv6 IAID . . . . . . . . . . . : 393902512
    DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-14-97-7B-83-00-26-18-9B-83-FC

    DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
    fec0:0:0:ffff::2%1
    fec0:0:0:ffff::3%1
    NetBIOS over Tcpip. . . . . . . . : Enabled

    Ethernet adapter VirtualBox Host-Only Network:

    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter
    Physical Address. . . . . . . . . : 08-00-27-00-FC-39
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes
    Link-local IPv6 Address . . . . . : fe80::451f:6d5d:c089:78ad%24(Preferred)
    Autoconfiguration IPv4 Address. . : 169.254.120.173(Preferred)
    Subnet Mask . . . . . . . . . . . : 255.255.0.0
    Default Gateway . . . . . . . . . :
    DHCPv6 IAID . . . . . . . . . . . : 554172455
    DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-14-97-7B-83-00-26-18-9B-83-FC

    DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
    fec0:0:0:ffff::2%1
    fec0:0:0:ffff::3%1
    NetBIOS over Tcpip. . . . . . . . : Enabled

    Ethernet adapter VMware Network Adapter VMnet1:

    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet
    1
    Physical Address. . . . . . . . . : 00-50-56-C0-00-01
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes
    Link-local IPv6 Address . . . . . : fe80::4c8b:c1d4:5974:ec81%26(Preferred)
    IPv4 Address. . . . . . . . . . . : 192.168.95.1(Preferred)
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . :
    DHCPv6 IAID . . . . . . . . . . . : 604000342
    DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-14-97-7B-83-00-26-18-9B-83-FC

    DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
    fec0:0:0:ffff::2%1
    fec0:0:0:ffff::3%1
    NetBIOS over Tcpip. . . . . . . . : Enabled

    Ethernet adapter VMware Network Adapter VMnet8:

    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet
    8
    Physical Address. . . . . . . . . : 00-50-56-C0-00-08
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes
    Link-local IPv6 Address . . . . . : fe80::e4e9:2b3:1ec5:c324%28(Preferred)
    IPv4 Address. . . . . . . . . . . : 192.168.245.1(Preferred)
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . :
    DHCPv6 IAID . . . . . . . . . . . : 637554774
    DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-14-97-7B-83-00-26-18-9B-83-FC

    DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
    fec0:0:0:ffff::2%1
    fec0:0:0:ffff::3%1
    NetBIOS over Tcpip. . . . . . . . : Enabled

    Tunnel adapter isatap.{C2B67837-74B7-41A0-8624-910F3DA5610B}:

    Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Microsoft ISATAP Adapter
    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes

    Tunnel adapter isatap.{5493B0A6-4EC1-4B12-9A00-70292DB7F667}:

    Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes

    Tunnel adapter Local Area Connection* 11:

    Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes

    Tunnel adapter 6TO4 Adapter:

    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Microsoft 6to4 Adapter
    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes
    IPv6 Address. . . . . . . . . . . : 2002:55a:d359::55a:d359(Preferred)
    Default Gateway . . . . . . . . . : 2002:c058:6301::c058:6301
    DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
    fec0:0:0:ffff::2%1
    fec0:0:0:ffff::3%1
    NetBIOS over Tcpip. . . . . . . . : Disabled

    Tunnel adapter isatap.{04845E34-963F-4BEA-8BFD-7FF4D4A99C07}:

    Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes

    Tunnel adapter isatap.{07F689BD-3743-4996-A8CC-E58889412F9F}:

    Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Microsoft ISATAP Adapter #4
    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes

    Tunnel adapter isatap.{F5514888-3D24-42D7-AD2B-15F76B1F3F38}:

    Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Microsoft ISATAP Adapter #5
    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes

    Tunnel adapter isatap.{B5D69926-5EE3-4C5A-A0E5-C82D8C378745}:

    Media State . . . . . . . . . . . : Media disconnected
    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : Microsoft ISATAP Adapter #6
    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes

  19. jbusci
    Member
    Posted 2 years ago #

    so DHCP is disable on the interface that you are reporting as your internal IP address.

    Is that the interface that your webserver is running on?

    Your webservers internal IP address should not be forwarding you to your router/modems internal IP address (default gateway)

    what happens when you type in 192.168.254.254 in your browser?

    do you get the same results as typing in 192.168.254.14?

  20. kmessinger
    Volunteer Moderator
    Posted 2 years ago #

    @jbusci If you ask someone to post code more than 10 lines it is best to ask them to use http://www.pastebin.com

    [edit]http://codex.wordpress.org/Forum_Welcome#Posting_Code

  21. bigbass1997
    Member
    Posted 2 years ago #

    that is correct jbusci. 192.168.254.14(Int. IP) has the same outcome as 192.168.254.254(default gateway).

  22. ClaytonJames
    Member
    Posted 2 years ago #

    @bigbass1997

    To fix this I thought that I could change the WordPress and Site address (URL) from "http://localhost/wordpress" to "http://bigbass1997.info.tm/wordpress". Once I changed that it no longer let me connect from my computer since it would try to take me to http://bigbass1997.info.tm/wordpress, which would cause it to send me to my modem control panel. This is due to the fact that my domain name is the same as my IP

    Changing the site urls is not enough. The urls stored in the database must be changed as well. Once that is correctly done, your site is no longer accessible from the browser on the server using localhost in the address. (host file exception noted, but usually not necessary, and assumes browser access from the server as the motive)

    I just looked at //bigbass1997.info.tm/wordpress/, and it has localhost in all the URL's

    Step one is to get it working with your domain name. That means first, changing the urls in the dashboard to point to your domain, not localhost, and second, to replace all of the references to "localhost" that are stored in your database with your domain name.

    Moving WordPress I recommend you read it all before making changes. Mind the warning in this sectionWhen Your Domain Name or URLs Change "search and replace on your entire database to change the URLs"

    When you forward a port on your modem/router, it only works for those outside your network. That is why there is such a thing as localhost, for anyone using the computer that is hosting the service.

    That is not necessarily an accurate assumption. Most routers have no issue with resolving a request to a machine back inside your own lan. Just changing the wordpress urls and not the database references (and, or using numeric ips anywhere) is just triggering an authentication request from your router. It has nothing to do with why "localhost" exists.

    Fix your site urls and the database urls to reflect the domain name, and 90% of the other fud will no longer be an issue.

    1. static internal ip address on the host, static ip address for your residential account - if you aren't using a dynamic ip service. (seems you probably have both of those handled)

    2. port forward at least port 80 to the static internal ip address

    3. edit the host containers in httpd.conf so that your domain name will properly resolve to your sites in /www/html

    4. change the site urls and edit your database so all of the urls contain your domain name, not "localhost".

    Do those correctly, and your site should be available from both the wan and your lan. Barring any router configuration issues (like one of those bizarre Frontier-provided modem/router combination boxes) or an insistence that you must keep using the browser located on the server to view your site, there should probably be no reason to edit the hosts file.

Topic Closed

This topic has been closed to new replies.

About this Topic