Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAMPP Site Redirects to localhost

Tags:

xampp

I have set up a wordpress multisite installation on my xampp localhost.

I went to update xampp this morning to a newer version, and it screwed my database. I've since re-installed the older version of xampp, re-imported my database and re-imported my sites folder to htdocs.

I had it set up so I could go to mysite.com and it would direct me to the correct sub folder.

Now when I go to localhost or mysite.com it redirects me to localhost.

If I do localhost/mysite then I get a 404 error not found.

Did I miss a step?? Database is re-imported and connected, my .htaccess file is set up properly (as I didn't change any of the settings) and my wp-config.php file is set up correctly (again didn't touch it).

Thanks


Ok as per a request I'm including my .htaccess. I know that it is set up correctly.

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
like image 452
EHerman Avatar asked Jan 20 '26 01:01

EHerman


1 Answers

I was able to resolve the issue. I forgot to set up a virtual host inside of my

httpd-vhosts.conf file:

First I uncommented this line (removed the hashtag(#)) :

NameVirtualHost *:80

Next I added this to the bottom:

<VirtualHost *:80>
    DocumentRoot "S:/Server Files/XAMPP/htdocs/MySiteFolder/" #path to site directory
    ServerName mysite.com #url you would like to type in url bar to hit your site
</VirtualHost>

Hopefully this helps someone, as I just sat here for 4 hours trying to figure this one out.

like image 100
EHerman Avatar answered Jan 23 '26 14:01

EHerman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!