If you have defined Virtual Hosts, and thats a very good idea, then you need to define the vhosts name in the HOSTS file.
For example, the hosts file:
127.0.0.1 localhost ::1 localhost 127.0.0.1 vhost1.dev ::1 vhost1.dev 127.0.0.1 vhost2.dev ::1 vhost2.dev
Otherwise windows has no way of knowing where to look for them.
Another possibility for localhost not working is a corrupted HOSTS file. Try deleting it and recreating it with an editor that is not notepad.
Also when you change the HOSTS file you need to restart the dmscache service ‘DNS Client’ by either rebooting or better still run a command window using “Run as Administrator” and do this
net stop dnscache net start dnscache
that activates the new entries in your hosts file.
Related Posts:
- 404 Not Found The requested URL was not found on this server
- XAMPP, Apache – Error: Apache shutdown unexpectedly
- XAMPP installation on Win 8.1 with UAC Warning
- WAMP won’t turn green. And the VCRUNTIME140.dll error
- WordPress Subdomain MultiSite on localhost XAMPP on :8080 with IIS taking port 80
- how to config the home page locally
- How can I view my site directly from WordPress dashboard?
- Localhost WordPress Uploading of Images Issue
- Issues when moving from server to MAMP
- What is the difference between XAMPP or WAMP Server & IIS?
- How do I use MySQL through XAMPP?
- How can I use an .htaccess file in Nginx?
- .htaccess redirect http to https
- Getting an error when I visit http://localhost
- What is the difference between Local Server and a Web Server?
- How to run php files on my computer
- Whats the point of running Laravel with the command ‘php artisan serve’?
- Cannot access to localhost/xampp/index.php
- localhost/xampp/ or http://localhost/index.php can’t be accessed
- PHP $_SERVER[‘HTTP_HOST’] vs. $_SERVER[‘SERVER_NAME’], am I understanding the man pages correctly?
- How do I run a file on localhost?
- Xampp MySQL not starting – “Attempting to start MySQL service…”
- #1045 – Access denied for user ‘root’@’localhost’ (using password: YES)
- SVN Error E175002 while checking out code from repository
- XAMPP Apache won’t start
- htaccess – Redirect to subfolder without changing browser URL
- Enable PHP Apache2
- client denied by server configuration
- What is HTTPD exactly?
- XAMPP: Connecting to localhost fix? [Persistent]
- Request exceeded the limit of 10 internal redirects due to probable configuration error
- How do you redirect HTTPS to HTTP?
- Adding a user on .htpasswd
- a2enmod command not found in apache server using cpanel in linux vps
- How do I disable directory browsing?
- Apache and Node.js on the Same Server
- Apache is downloading php files instead of displaying them
- lbmethod_heartbeat:notice – No slotmem from mod_heartmonitor –error after installing apache2.4.2 [closed]
- Difference between Systemctl and service command
- “End of script output before headers” error in Apache
- org.apache.jasper.JasperException
- Https to http redirect using htaccess
- Site does not exist error for a2ensite
- .htaccess: Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration
- PHP code is not being executed, but the code shows in the browser source code
- WordPress localhost not working
- Relative or dynamic site url possible?
- How do I get the right permissions for WordPress running Apache on Debian
- WP Asking for FTP Credentials with XAMPP Localhost
- How can I improve site/page performance of WordPress websites?
- Connect to remote database using Localhost install
- Best practices for making a WordPress site “movable”?
- WordPress V2 REST-API: Endpoints 404?
- How to configure self hosted wordpress so that everything can be upgraded/installed from dashboard
- Installing WordPress in a Sub-Folder (not in root) on Localhost
- Connect to live db whilst working locally
- WordPress multisite causing Error 101 (net::ERR_CONNECTION_RESET): Unknown error [duplicate]
- What’s the proper way to setup WP-CLI on Ubuntu so that I don’t have to use the flag –allow-root?
- Which Apache-modules must I enable?
- What are some good Apache settings to use with wordpress?
- How can I find the cause of theme crashing Apache in Xampplite?
- Why isn’t my imported database showing up? install.php pops up and adds new tables to the database
- WordPress redirecting to 127.0.0.1 when accessing the site from a remote device
- WAMP to XAMPP WordPress transfer
- After finishing building a site on localhost, how do I transfer everything to a client’s server?
- I have a desktop and a laptop: What’s the best way to move between local installations?
- Is XAMPP faster than running LAMP in WSL on Windows 10? [closed]
- Multisite on localhost using xampp
- WordPress on a local machine redirecting to xampp dashboard page [closed]
- Why is the domain name missing from the logout redirect?
- Cannot complete migration on LAMP
- Point root folder to blog.domain.com and subdirectory to domain.com possible?
- Unable to log in to localhost wp-admin page on XAMPP server
- Can only access homepage and admin panel
- Detect CURLOPT_SSL_VERIFYPEER programatically?
- Issues copying site into local machine
- Setting up a local copy from a production site
- Internal Server Error apache
- Localhost WordPress not recognizing my online WordPress account
- can’t see aditional themes in control panel
- What to do when WordPress posts on a new server return an error 404
- Accidentally messed up URLs
- Show wordpress locally in xammp and in iPhone via ip
- Locally restoring a ManageWP full site backup
- WordPress docker with empty responses to HTTP requests
- Serving WordPress in it’s own directory on localhost on WAMP
- White Screen of Death for unknown reason but fixes after rebooting the server
- change wordpress upload url to subdomain on xampp local
- Why don’t WP themes download completely on my localhost (XAMMP)?
- Forbidden You don’t have permission to access this resource. Apache/2.4.41 (Ubuntu) Server [closed]
- Absolute Hyperlinks in WordPress Website Will Not Work In the Local Server
- WordPress page not accessible through WAN [closed]
- Caching plugins + mod_pagespeed = overkill?
- Virtual HostX and MAMP not working with WordPress
- Plugin not working locally, but works on server
- Local install not loading template images but is loading everything else XAMPP
- I Made WordPress Multisite. And Now Everything Doesn’t Display Properly
- If I use Apache & ngnix together will I have fewer problems?
- How to enable %postname% permalinks on Mac?
- WordPress: redirecting to my old public ip