Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm not sure if this is the right place, if this is the case I will move the question with no problem.

I'm setting up a web server for testing Wordpress. Everything works fine if I try to access the website from the same machine, but when I'm trying to access the root directory of the web site (running in my laptop) from a different machine (inside the intranet) I will get an unable to connect.

I'm passing the IP to the web browser, but the browser redirects itself to localhost. If I ask for a specific file readme.html in the root directory I can read the file from the external computer.

During the installation I set the HOSTNAME of Wordpress to localhost, so I'm guessing there might be some problem with redirection to the wrong machine. If I try to change this name (in the machine running Wordpress) to the name of the machine running Wordpress (the name of the machine is Bestia), Wordpress stops working.

Can anyone provide me some ideas as to a possible solution?

.htaccess file:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

Update

In the file wp-config.php is present a line

define('DOMAIN_CURRENT_SITE', 'localhost');

when I try to change the string localhost, redirecting is different from my external computer (actually on both machines); e.g. if I change localhost to Bestia when I call the IP 192.168.0.111 from the browser of my external machine I am redirected to Bestia (and of course the request fails on both machines, 'cause I have not a DNS server inside my network).

share|improve this question
    
examine your .htaccess file. it might be redirecting it to localhost –  Raza Jul 13 '13 at 0:00

1 Answer 1

up vote 1 down vote accepted

Change the domain to your IP address instead of Bestia. Also, according to Wordpress support you can do that in the administration interface, in General -> Settings. That's 4 years old, but there's also a more recent post on Stack Overflow that may be helpful.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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