I have tried to setup XAMPP server for testing my own WP website locally on my Windows 11. XAMPP was installed correctly – I use default apache port 80 because there is no conflict with other apps, and a DB was imported successfully without an error.
The root directory of my dev site is in C:/xampp/htdocs/test/
a) The followings are working:
http://localhost
http://localhost/phpmyadmin/index.php
b) PHP homepage on local XAMP server displays 404 not found page:
http://localhost/test/ or http://localhost/test/index.php
c) HTML homepage works:
http://localhost/test/index.html (I put that index.html in root directory above for testing)
d) Category page is redirected to http://localhost/dashboard/:
http://localhost/test/cat/services/
-I have tried to configure virtualhost in C:xamppapacheconfextrahttpd-vhosts.config:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/test/"
ServerName web1.localhost
</VirtualHost>
-and in C:WindowsSystem32driversetchosts:
127.0.0.1 localhost
127.0.0.1 web1.localhost
But they dont work at all, and even rediects some of the pages above to my live website’s homepage.
How can I fix this issue?