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
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?
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.Open
wp-config.php
file within WordPress root. at the beginning of the file, right after the batch documentation add these two lines:changing
mysite
string to whatever your document root folder is underC: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
andWP_SITEURL
, so you may change it manually into IPv4 version, thorough Menus submenu under Appearance