Hosts file redirect to local computer directory - windows

I have a local Apache server running on my desktop which allows me to run a local site which I want to access from my laptop.
I'm able to access the computer in my hosts file using '192.168.0.5 liam.pc' but I can't figure out how to enter a directory. I've tried '192.168.0.5/Hudex/public hudex.dev' but it doesn't seem to work.
How can I accomplish the effect I want?
HOSTS file:
127.0.0.1 localhost
127.0.0.1 zheil.dev
192.168.0.5 liam.pc

Related

MacOS doesn't resolve localhost to 127.0.0.1 (ignores hosts / apache vhosts)

I ran into the problem, that localhost redirects to a specific domain instead of 127.0.0.1.
My configuration is a local apache/mysql/php installation on MacOS Mojave using vhosts for different projects that are configured in hosts to redirect properly.
When I enter 127.0.0.1 in any browser, I get to my overview page lying in the www root. The same should happen, when I enter localhost in the browser, but instead it redirects to a domain of a project I was working on in the past. It happens also without network connection, so the configuration is on this machine.
My /etc/hosts file:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost project1.local project2.local
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
The first line seems to be ignored and localhost doesn't resolve to 127.0.0.1.
I only have two vhost configurations plus default configuration with no wrong redirection and also the httpd.conf lookes fine. I searched the whole machine with grep -lr "redirectiondomain.com" * without results. I tried with apache switched off with the same result and looked up the MacOS network settings but I can't find anything related to the wrong redirection neither any other solution on stackoverflow or google that solves my issue. Has anybody a clue how the wrong redirection of localhost could be set somewhere else?
Edit: My hostname in MacOS is set. I tried localhost without port, with :80 and :8080

Can't access vagrant urls from hosts.

I am trying to setup my vagrant virtual box enviorment for development. Everything works fine. I have the shared folder setup and can access the information from my browser but only using the ip address. I can't use the website.app urls from windows even after i put it in my hosts file.
I used https://puphpet.com/ for the configuration file.
This is my hosts file:
192.168.56.101 website.app

homestead machine is running but urls not found

I am using homestead and it is my first time. now i can run the homestead up and machine starts.
i edited the homestead.yaml file and i edited hosts file but when i try to go to my website in the browser it says that the webpage is not available.
for more information i am using windows and virtual box and here is my hosts file
127.0.0.1 localhost
192.168.10.10 exam.dev
i am wondering what can i do to fix this problem. what i am missing here?
Edit: i tried to ping the 192.168.10.10 but it says that destination host is unreachable

how to redirect example.com to 127.0.0.0/main/test?

i'm using wamp 5, windows XP. i have edited my host file in my local disk like the code below and it works
127.0.0.0 example.com
but i'd like to redirect to a particular folder, if i change it to the code below, it dont work
127.0.0.0/main/site example.com
how to redirect example.com to 127.0.0.0/main/site locally in my PC?
btw, i dont want to install any new software to solve this prob
You need to create a Virtual Hosts
Leave the HOST file as
127.0.0.1 example.com
When you define a Virtual Host you also tell it which folder is its DocumentRoot so that will send it to the right place when you use the address example.com in the browser.
Check out wampserver.com

How to forward calls from my remote host to my local one

I wish all calls to my_remote_host:port to be redirected to my_local_host:port, where my remote host is Linux and my local host is Windwos
Open File C:\Windows\System32\drivers\etc\hosts
127.0.0.1 my_local_host

Resources