0

I'm running localhost server on xampp. I 'm connecting properly with my host computer from other devices with IP address but once i go into wordpress directory i got redirected. Every device i was testing changed entered IP/wordpress to localhost/wordpress.

Strange fact is that i have 3 exact copies of wordpress. One of wchich is installed on Windows8, second Windows10 and 3rd one on Ubuntu. There's no problem to connect with windows installations even from Ubuntu but not the reverse.

I've already tried to change wp-config.php file by modifying :

define('WP_SITEURL', 'http://LOCAL_HOST_IP/wordpress');
define('WP_HOME', 'http://LOCAL_HOST_IP/wordpress');

And it works but only partial. iOS device is connecting properly with host wordpress but windows computer and android based tablet isn't. What can cause such problem?

2

Trying to change edit the wp-config.php file was a good idea, let's try some extra things to see if they solve the problem. Let's add these lines to the bottom of your functions.php:

update_option( 'siteurl', 'http://LOCAL_HOST_IP/wordpress' );
update_option( 'home', 'http://LOCAL_HOST_IP/wordpress' );

Using Relocate method

Edit your wp-config.php file inserting:

define('RELOCATE',true); 

After that, from your browser manually access to wp-login.php. For example, type http://LOCAL_HOST_IP/wordpress/wp-login.php into your browser's address bar, and then login as usual.


Changing the URL directly in the database

  1. Login to phpMyAdmin.
  2. Find your DB and then the table wp_options
  3. Look for siteurl and home within that table
  4. Use http://LOCAL_HOST_IP/wordpress for both and save.

Check the full Codex Changing Site URL guide.

  • I've tried those methods. Function for updating rows in database works properly but the problem still appears. Only iOS device is connecting with host wordpress. In some way it makes me think that is some problem with my Ubuntu configuration but why only when im accessing wordpress? It's not redirecting me from xampp folder even if i go into subdirectory. Some security cross-platform issue? I've checked that. When i disable firewall on my host i can access wordpress but not from the chrome browser i was previously using. – Bartosz Was Aug 24 '18 at 8:16
1

Problem solved

Wordpress and its configuration wasn't the issue here. The real reason why site was working on some devices and on others don't was cached files in browsers. Solution was to clear cached files or trying to develop in private mode browsing which isn't caching files.

Also i want to point out that when you want to access host from other computer you have to disable firewall. Strange fact about all this is when you can access to host and see it's dashboard while firewall is enabled going into wordpress directory will cause error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.