• Resolved flammobammo

    (@flammobammo)


    Hi,

    I’ve recently discovered the wonderful things that can be done in the .htaccess file, and thought it may help me to be able to setup my wordpress install, such that when my locally installed (i.e. running from my computer) blog is offline (i.e. when I have no internet connection), I can still browse my blog/work on it.

    So what I want to do, is use the .htaccess file (if possible) to allow me to point to http://mylocalcomputername instead of http://mydomainname, and have the .htaccess file rewrite anything and everything to do with http://mydomainname to http://mylocalcomputername

    I’m thinking along the lines of something like:

    RewriteRule /.* http://mylocalcomputername/ [R]

    although this obviously isn’t correct as otherwise I wouldn’t be posting πŸ˜‰

    I realise this is probably a more appropriate question for the apache forums, but I figure that this would be highly useful to anyone that is running WordPress from their local computer, such that it would speed their browsing, and save on ISP bandwidth traffic.

    Thanks in advance, and apologise this is not 100% WordPress related.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter flammobammo

    (@flammobammo)

    I’ve discovered that when I’m working offline, I can just change the wordpress and blog directories (in Admin -> Options) to http://localhost although this still isn’t as elegant as it could be.

    I’ve found un-answered questions to this on an apache forum, but should find the answer eventually and will post when I do.

    Thread Starter flammobammo

    (@flammobammo)

    Note: I’ve taken this question to

    webmasterworld

    and as mentioned above will post soultion here as well.

    There will be no solution, I guess.
    The two URI values are in the database and called for internal links, the stylesheet etc.

    You cannot have localhost AND and internet address in the same time.

    Thread Starter flammobammo

    (@flammobammo)

    Thanks for your opinion moshu, however I’m not sure why you said what you did. What exactly do you mean when you say you can’t you have localhost and internet address in the same time?

    Regardless, in the webmastersworld forum (link above) a solution was pointed out to me.

    You search for the hosts file (in my case c:\windows\system32\drivers\etc\hosts) which has no extension, and simply add the line under:

    127.0.0.1 localhost

    you add:

    127.0.0.1 mydomainname_oninternet

    You can then unplug your computer from the internet (i.e. your router, or leave it plugged in and just loose connection, or whatever!) and the page will load. However it will load painfully slowly, because you are most likely still using the DNS lookup of your router, or your ISP.

    To force windows (or linux or whatever) to check the hosts file first for local DNS resolution, go to your TCP/IP properties for your network connection, and make 127.0.0.1 your primary DNS, and your router your secondary DNS. (Or if you have a primary and secondary from your ISP, make them your secondary and third, the third can be done in windows by clicking on the DNS tab.)

    You can then load your local website like magic offline. However, I haven’t currently got a connection to the net at home so aren’t 100% sure what it will do when I get back online. Also, I can’t get other computers on the LAN to load the webserver… yet!!

    Tom

    In summary, people with wordpress installtions on their local computer can same a lot of ISP/router traffic by doing the above.

    You’re still going to run into the “synchronization” brick wall: what you do offline (no matter how you set it up – I’ve had a simple local XAMPP server for about 5 years, without ANY need to discuss it with wmw) will require some sort of “synch” or “mirror” technique in order to display online and vice versa.

    And all you’re loading is a local cache of the last online view. *shrug* Without a connection you just don’t have “live” blogging. That’s life.

    Thread Starter flammobammo

    (@flammobammo)

    Ummm actually vkaryl I cleared the browser cache, updated my blog heavily, and yes it actually does update the page whilst no internet connection is present… so maybe you should try what I’ve done? .. Have you tried what I’ve done before saying it doesn’t work? πŸ™‚

    Perhaps vkaryl being a moderator, you could remove your post (and then this one too) so that other browsers don’t think this doesn’t work.. because.. it does!

    Yup. I’ve tried it. A while back…. I wonder if it has to do with the difference between dialup and broadband then?

    [Btw, I don’t generally post stuff unless it’s something I have personal experience with.]

    Thread Starter flammobammo

    (@flammobammo)

    vkaryl,

    Perhaps if you try it again, and post your results here in thorough detail, we can get it working for you this time? Would love to help.

    Tom

    I don’t understand half of your solution… but if it means that I cannot load your site (operation timed out) than we shouldn’t really publicize it here πŸ™‚

    Thread Starter flammobammo

    (@flammobammo)

    The whole point of me doing this is because I’m “offline” … and my wordpress install is hosted on my webserver. So … I’m offline, and so is my blog!! πŸ™‚

    I’m currently working on my site until I get changed over to a new ISP, and that’s the whole reason for me posting this in the first place… because I’m offline!! πŸ™‚

    If you read all the posts carefully it should make sense to everyone, but if you still “don’t understand half of it” let me know what that is, and I’ll edit the post.

    Thanks,
    Tom

    So, what’s the point having an offline blog?

    I also have a nice local WP install on XAMPP πŸ˜‰ – to work on themes, design, to test different stuff.
    And for the real website and blog(s) I pay 5 bucks a months – and no headache.

    Thread Starter flammobammo

    (@flammobammo)

    So, what’s the point having an offline blog?

    Refer to above about why my blog is offline. If you are still genuinely interested as to why my blog is offline, ask the folk atIt’s very much an optional tweak, which saves router/ISP traffic, makes your page load faster when browsing on your own computer (particularly when simultaneously using peer-to-peer software, etc).

    I also have a nice local WP install on XAMPP πŸ˜‰ – to work on themes, design, to test different stuff.
    And for the real website and blog(s) I pay 5 bucks a months – and no headache.

    As for the point of having an offline blog, it’s not something I deliberately intended on doing, but to change to a faster ISP it’s something that has to be done.

    And for completness, regarding the 5 bucks a month, it would actually cost me a lot more than that (in my currency) due to the large amount of data hosted on my site with my photo gallery that I maintain for family and friends.

    Also, I’m intending on virtual-hosting other sites in the near future, so unlimited storage space is good. But this is getting off topic, so I shall stop.

    Thread Starter flammobammo

    (@flammobammo)

    Something I may consider writing a plugin for Firefox1.5 for, is to allow for manual and static caching of DNS entries in the DNS cache for Firefox.

    To see what I’m talking about you type (in Firefox) About:Config in the url bar, and filter for anything containting ‘DNS’. I’ll take this up in the mozilla forums, and if it eventuates to anything that may be useful for WP users I’ll post it back here, or PM me to find out what I’ve dug up.

    flammobammo: I’ve gone a different direction entirely since I tried this, so don’t have the need to do it at this point. However, should it arise, I will certainly try it again using your pointers.

    I sure hope you get your project worked out flammobammo, can’t wait to hear more.

    I’m interested in it so that I am in control of the blog data, not the ISP. Last week was the final straw and now I’m scared to even start posting again. All I did was download my whole domain to my PC (which is very small right now) to ensure that I was synched up with what was online, my one dir matched the domain ftp dir (because I may have uploaded from another sub-dir in the past and this would guarantee a complete code backup). With my blog open at the time, I downloaded everything, not deleted, and when it was done about a minute later, I started back working on the blog, but the admin and viewable blog both went white. All the data was still in the ftp so I don’t know what the heck happened, but I’m crazy tired of starting blogs over & over (5 times in one month, although 2 of the others were because of ISP moves) and just want to be in control of the data myself. Their restore did nothing for me so once again, out all the work I did on the blog previously.

    Anyway, enuff of my data loss hell, here’s the thread http://wordpress.org/support/topic/57254?replies=29#post-311370
    I was going thru when I was pointed to yours so I’m all ears on your results. G/L.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Local server – working offline using .htaccess?’ is closed to new replies.