Page 1 of 1

Xampp 404 Remote Connections only working fine on localhost

PostPosted: 22. March 2017 14:37
by Fez
Hi,

I am running into a really odd problem. I have a wordpress install running on ubuntu 16.04 set up with xampp 7. The website is working fine, I have looked over the files permissions and everything is great even the .htaccess file is working well and the wordpress pages are being loaded correctly with mod rewrite. The problem only occurs when I try to save a post from the back end. If I am connected to the website via a remote computer it just throws a 404 error (with nothing in the logs) and when I am working directly on the server that has xampp installed on it and open the site admin via firefox and save a post it works perfectly fine.

It's really odd, I've searched for hours and have not come up with any solid answer.

Thanks in advance.

Re: Xampp 404 Remote Connections only working fine on localh

PostPosted: 22. March 2017 16:58
by Altrea
Hi,

Which keywords did you google? Which google hits have you tried and which results did you get?
I would google for "how to debug wordpress 404 error" and get 1.4 Million hits.

I cannot see any reason this could be an XAMPP issue.
Maybe a wordpress related soppurt channel could help too, or a support channelr elated to that wordpress module you are using.

best wishes,
Altrea

Re: Xampp 404 Remote Connections only working fine on localh

PostPosted: 22. March 2017 18:04
by Fez
Hi,

I understand what you are saying and that's exactly what I thought. I tried to troubleshoot all wordpress related problems. I deactivated my theme and deleted all plugins went back to defaults but the problem persisted. Still I was sure it was a wordpress issue. Untill I saw that I was able to do everything just fine when I was accessing the website on the machine xampp is installed on. Only when I try to access it externally it throws me a 404 message. I think it could be related to saving / publishing posts only as it throws that error in that scenario and works fine with all other mod rewrite urls.

Edit:

To clarify,

When I use my pc to access the website admin panel and try to save or publish a post or save or publish anything else it gives me a 404 error. I can still access the website just fine.

On the machine xampp is running on when I try to do the same things in the admin panel it works just fine.

This is why I am thinking it's a xampp issue.

Re: Xampp 404 Remote Connections only working fine on localh

PostPosted: 22. March 2017 19:24
by Altrea
I am still thinking that this is a wordpress issue.

Which URL do you use locally?
Which URL do you use externally?
Which URL is defined in Wordpress as base url?

Re: Xampp 404 Remote Connections only working fine on localh

PostPosted: 22. March 2017 19:55
by Nobbie
Fez wrote:When I use my pc to access the website admin panel and try to save or publish a post or save or publish anything else it gives me a 404 error.


You probably installed WordPress to "localhost". Think about, what "localhost" means and what it means on a remote PC. Do not answer until you got what i mean! Think!

Re: Xampp 404 Remote Connections only working fine on localh

PostPosted: 23. March 2017 08:34
by Fez
Hey,

The local pc is configured for the url example.com and the entry is made to hosts 127.0.0.1 for example.com

The same url is being used when accessing it remotely. I've defined the same url inside WordPress too.

Re: Xampp 404 Remote Connections only working fine on localh

PostPosted: 23. March 2017 09:30
by Altrea
This can be a problem if you defined namebased virtual hosts in Apache and used the domain as part of the leading <virtualhost> line

Re: Xampp 404 Remote Connections only working fine on localh

PostPosted: 23. March 2017 10:13
by Fez
Figured out the problem. The networking guys had set up an external firewall which was blocking the requests from remote connections. It's really odd that it was throwing a 404 error though. Really appreciate your help on the matter.

Re: Xampp 404 Remote Connections only working fine on localh

PostPosted: 23. March 2017 13:58
by Nobbie
Fez wrote:It's really odd that it was throwing a 404 error though.


Indeed, thats not only odd, that MUST NOT happen. A 404 error means, that the request did pass the firewall (because this response is coming from the remote PC, which should be blocked by the firewall). There is something wrong, a firewall cannot cause a 404 error.

Re: Xampp 404 Remote Connections only working fine on localh

PostPosted: 23. March 2017 16:09
by Fez
Exactly what I thought but I disabled the firewall and everything started working normally. I noticed that its only happening when a request is being sent via ajax in wp-admin I still do not know why or how its throwing a 404 error but when I refresh the page that shows the 404 error it loads it just fine.

For example:-
The request would go to /wp-admin/post.php?id=xyz
pressing the update button will take me to 404 for the same url /wp-admin/post.php even though it exists and when i would press the refresh button it loads that page just fine.

Its so odd.