How to access a localhost subdomain? - php

I have a script which redirects the user to a mobile subdomain like m.localhost.com if he/she access the local site on a mobile phone or tablet. Everything works fine on my PC (The place where my local website is hosted and I'm using Apache 2.4 and PHP 5.5) but when I type my ip into my mobile browser for example, it redirects me to (m.192.168.1.102) and when I type localhost.com it doesn't shows me my local website even though the host and the mobile are connected to the same network. I don't want to edit every hosts file on every device, I just want to visit the subdomain on another device rather than my PC. I know it might be a stupid question but how does the hosts like 000webhost and Ifastnet and many others redirect their users to subdomains?
Thanks in advance

Related

How do stop PCs that are connected to my WikiMedia from redirecting to localhost instead of the hosting PC's IP?

Making a wiki over the LAN for my company. When I input the URL of the wiki on any computer in the network that isn't the host
ex. http://192.168.123.45/wiki/index.php/
It redirects to this:
ex. http://localhost/wiki/index.php/
I have to manually enter the IP of the host each time. This also happens if I try to go to any of the pages I have made on the Wiki. When I reenter the URL, it works every time.
If it helps, I am using XAMPP 8.1.6.

Access remote IP address homepage remotely through webserver

Scenario:
My company network has a machines with dedicated IP address. When we enter each IP on our browser within the company network, it takes us to the machine diagnostic page. What i am trying to accomplish is to access these machines remotely from our webserver. I tried adding a link on our website with 10.116.192.5 and it obviously didnt take me to the machine because i was out of that network. Is there anyway i can access these IP on my office network through our website?
I tried using cURL but that does not work with java applet. So i am trying to find an alternate solution to it.
Would using iframe work in this scenario?
Rephrasing the scenario: Trying to redirect our website URL to point to an internal IP address URL. So for instance, if a client types www.scada.example.net/userinfo on browser, this would redirect on the server side internally to x.x.x.x and display on the client side as www.scada.example.net/userinfo.

ERR_CONNECTION_REFUSED while accessing an image file on local network

I have 2 websites running in my IIS in one machine. One is the PHP website and another is the ASP.NET WebApi. The PHP site is my family website which is kind of an adapter between HTML and WebAPI. Now, in my PHP site I have a page which loads all family pictures from a selected folder on my home wifi network.
If I browse PHP site from the same machine where API is hosted then everything works great. But when I browse my PHP site from other machine in my home wifi network I see ERR_CONNECTION_REFUSED
As far as the permisssions are concerned I have IUSR full control over my image folder.
Any idea where I am missing the mark?
Your Internet is not working or the server is not set up to receive http request

How to access localhost using mobile browser?

Hello I am using WAMP server in my pc, I am developing website and the project is stored in C:\wamp\www\myproject folder. I connected my phone through WIFI and from the phone browser I am trying to access local host by entering my PC IP Address 192.23.141.30 but it does not displaying my project website.
Plese give me any method you know to access localhost if you know.
Thank's in advance...
Left click the WAMP icon in your taskbar and click 'Put Online'. This should allow access to everyone and not just localhost. Then enter the link into your mobile as 192.23.141.30/myproject.
Normally, you could access your localhost with your LAN ip. Make sure that your firewall don't block the access.
Alternative is to simulate your phone on your pc. See for example: http://www.opera.com/nl/developer/mobile-emulator

Navigating to various pages doesn't changing URL in Address Bar of Browser when running on server

My application running on amazon cloud server. when i navigate to various pages the URL remains my domain name . www.mydomain.com while when I navigate through ip binded for that domain it work fine, and when i am running the same application locally on XAMPP server then also it works fine.
I have binded my domain name with the ip of my server.
Can u guess the problem and describe the solution to me?
Due to this problem when user refreshes the page through browser by clicking on refresh button then always the home opens
Please check the configuration of your domain at your registrar.
Some registrars offer a "framing" or "web redirection" service in addition to a DNS service. The behavior you have described makes it sound like you're using one of those services instead of having correct DNS records.

Categories