How to browse WordPress links on a local network WAMP server

I have read a post on this topic but I have an issue.
This is what I did:

  • I have a WordPress site accessible locally using http://localhost/mysite
  • I put my WAMP server online from WAMP options
  • I disabled Windows firewall
  • I created a limited network between my PC and my Android phone successfully
  • I got the IPv4 address of my PC from network properties which is 192.168.42.219
  • I launched / accessed the website through my connected phone successfully with the address http://192.168.42.219/my site

But whenever I click on any link within the website, instead of opening

Read More
http://192.168.42.219/mysite/thepage

the address

http://localhost/mysite/thepage

shows in the address bar and

Page not found

error displays.

If I type the address

http://192.168.42.219/mysite/contact

on the address bar and enter, it will open correctly

How do I browse the site perfectly with all the links working?

Related posts

Leave a Reply

2 comments

  1. WordPress will try to honor the domain you define in the admin dashboard, so you must change it from there. You should be able to navigate using your IP address while in the dashboard without having the domain enforced.

    In case you can’t, you’ll need to edit a certain record in the wp_options table, but that would be overkill if the first way works.

  2. Open wp-config.php file within WordPress root. at the beginning of the file, right after the batch documentation add these two lines:

    define('WP_HOME','http://192.168.42.219/mysite');
    define('WP_SITEURL','http://192.168.42.219/mysite');
    

    changing mysite string to whatever your document root folder is under C:wampwww.

    Depending on your situation, you may need to hit a Save Changes on WordPress Permalinks submenu page, under Settings admin menu.

    Note that the homepage link is not populated dynamically through WP_HOME and WP_SITEURL, so you may change it manually into IPv4 version, thorough Menus submenu under Appearance