XAMPP's default port:80 is occupied by System.exe, so I have to switch to port:81, as this question suggested XAMPP PORT 80 is Busy / EasyPHP error in Apache configuration file:
After this change, I can access localhost:81/xampp and localhost:81/phpMyAdmin , as well as local files, like localhost:81/wordpress/Readme.html
However, I can not load other local directories in htdocs, can not install new wordpress site on my computer, and localhost:81/wordpress is auto referred back to localhost/wordpress , which is NOT FOUND
Here's a list of what I tried and failed
Change all localhost options to locahost:81, in C:\xampp\apache\conf\http.conf , in C:\xampp\xampp-control.ini , in MySQL Database, Database Tables, root User, in wordpress wp-config-sample.php , wp-config.php
I load localhost:81\wordpress in Chrome and it is auto referred back to localhost\wordpress , the result is NOT FOUND.
So I can not access to localhost:81/mywebsite because it is auto referred to the old localhost , and can not stop System.exe from using port:80. I searched almost every where, but the only solution I found is a mistyped mistake in wp-config.php - that is NOT my problem.
Plese help.
Try specifying port number in virtual host configuration. Hence you can avoid typing port number in url. Add these lines to C:/xampp/apache/config/extra/httpd-vhosts.conf
NameVirtualHost *:81
<VirtualHost *:81>
ServerName test.com
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Edit C:\Windows\System32\drivers\etc\hosts and Add
127.0.0.1 test.com
at the end of file. Restart apache. clear browser cache and just point to test.com.