• Dear all,
    Sorry this is such a newbie question, but I’m new to virtually all the software I’m using at the moment. I’m hosting my brand new WordPress blog on my own server on my own intranet that sits behind an ADSL router. If I set the WordPress and Blog address (URI) to https://localhost/blog then my blog is given the correct stylesheet only when visited on my own server. Conversely, if I set the URIs to my internet domain name, then visitors can see the correct CSS, but I can’t use WordPress at all, since accessing my broadband IP address on my intranet only brings up my router’s administration page or a 404 error page (I just tried this, and ended up delving deep into MSQL in order to recover my access). How do I get around this problem?
    My system is set up as follows:

    1. Eclipse Internet broadband connection plugged into…
    2. Netgear DG843G Wireless ADSL Firewall Router routing my intranet, and directing HTTP traffic to…
    3. My server, running Apache 2.0 on Fedora Core 2, hosting…
    4. My WordPress blog at /var/www/html/blog/index.php on my drive, https://localhost/blog/index.html on my server, https://192.168.x.y/blog elsewhere on my intranet, and https://www.webofcontradictions.net/weblog to the rest of the world ??

    Any advice would be much appreciated.

Viewing 7 replies - 1 through 7 (of 7 total)
  • TreadingSoftly,
    First of all, welcome to WordPress! Secondly, you just provided one of the best examples I have seen about how to properly ask for help in a support forum! Fourth–try setting your @import url( https://localhost/blog/wp-layout.css ); in your INDEX.PHP to the internet URI, instead of localhost and that should fix that.
    Have fun with your site!

    Thread Starter treadingsoftly

    (@treadingsoftly)

    NuclearMoose,
    Thank-you very much for the welcome and the prompt advice, but, unless I’ve misunderstood your suggestion, it won’t work. Editing my index.php to read @import url(https://localhost/blog/wp-layout.css); ensures that when loaded on my server index.php can find the stylesheet. But when loaded elsewhere on the net, it searches the net reader’s own localhost in vain (I checked this on my dial-up connection). Replacing the URL with a relative reference (@import url(wp-layout.css) allows index.php to find the stylesheet both on my server and on the internet. The problem then is that this is far from the only place that the php code makes reference to the URIs as specified in WordPress ‘Options’. Not only are their multiple such references within index.php itself, but they litter all the other php files. For example, I could change all incidences of get_settings('siteurl') to relative links within index.php. But if the reader clicks on ‘register’, (s)he is taken to wp-register.php, informed that registration is disabled, and presented with a handy ‘home’ link that is thoroughly broken, as it points at https://localhost/blog/index.php. And that’s only the reader’s experience – trying to administer or post to the blog involves many more php files that link back to the main page.
    So I think I need a more holistic solution as I can’t see myself changing all the php files everytime I reinstall or upgrade WordPress. I realise this isn’t necessarily a WordPress problem (although obviously it would help if there was a WordPress solution); perhaps I need to do some special network routing or fiddling with Apache, so that I could put the internet URLs into WordPress ‘Options’ and my server would know what to do with them (i.e. not direct me to my router’s admin page)?

    The problem is that your router will forward port 80 connections that come in on the internet interface…but it won’t do the same for packets coming from your LAN to prevent some obscure routing loops and such. The simplest fix is to add your internet domain to your hosts file with the same address as localhost. That way, rather than pointing your internet domain to the internet, it’ll avoid your router and work properly from your workstation. Any other users on the internet will be routed to the correct external address.
    In Windows XP, the file is located in ‘C:\WINDOWS\SYSTEM32\DRIVERS\ETC’ and would be called simply ‘hosts’. Open it in Notepad and add ‘127.0.0.1 https://www.domain.com‘ and ‘127.0.0.1 domain.com’ on seperate lines. Save the file and it should work properly.
    Keep in mind that if you ever get external hosting, you’ll need to remove those lines.

    Thread Starter treadingsoftly

    (@treadingsoftly)

    Thanks error404. That seems to work beautifully with Fedora too. ??

    adamwc

    (@adamwc)

    I am a complete newbie to wordpress and router configs and the such, but I have to say that installing wordpress was a breeze and very exciting.
    That said, I seem to have run into a brickwall with my router/hub, behind which my LAN computers, one of which is a wordpress server, reside. The issue is that when I connect to the internet via cable modem directly, I have no trouble seeing my wordpress blog installation and interacting with it. However, when I connect the server to my router, for whatever reason port 80 isn’t getting passed through.
    My router is 192.168.0.1, and off of that base, my webserver is 192.168.0.7.
    Under menu 15, SUA Server Setup, I made a rule, I guess, that the start port and end port number “80” would correspond to my webserver IP address. Seemed like the right thing to do.
    Under “system maintenance,” I disable the router’s port 80 web server for remote administration. This, at least, made it so that the router no longer asks for an admin login for its config tools. But, the browser hangs instead of pushing through to my webserver.
    Remote Node ? SUA Server Setup? Filter Rules? omygodiamsolostinthesemenus :-/
    And I’m the technical guy amongst my friends and acquaintances. So…
    Any insights anyone may have into what I need to do to get my router to pass port80 to my webserver, I would appreciate tremendously. Thanks in advance, guys and gals.

    I’ve got some questions about this too. Maybe anyone could help?

    I’ve got WordPress running on a UNIX (Fedora) PC (10.0.0.14) in my local network. This PC is also reachable from the Internet on its ‘external’ IP (84.***.***.***), because I’ve forwarded port 80 on my router (10.0.0.138) to 10.0.0.14.
    In my WordPress configuration, I’ve set the WordPress & Blog address to https://84.***.***.***
    Now WordPress is running perfectly and reachable from the Internet, but when I want to manage the Blog from another local PC, for example 10.0.0.10, the Blog isn’t rendered properly and all links refer to my external IP 84.***.***.*** which is unreachable for me within my own network.

    When I visit my Blog from another location (the office for example), I can manage it perfectly and it looks great.

    Now what should I do to be able to manage my Blog from a PC within my own Network, for example 10.0.0.10? I can’t do it by editing the hosts file as mentioned (tried it) because there’s no DNS-name directly refering to my external IP 84.***.***.***

    I hope I formulated my questions clearly. If necessary, I can always provide you with additional information.

    Thanks a lot in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WordPress and Blog URIs from behind router’ is closed to new replies.