Home > Net >  WordPress on Xampp has it's .htaccess file outside xampp's installation folder
WordPress on Xampp has it's .htaccess file outside xampp's installation folder

Time:03-08

I have a site I am currently developing using WordPress on localhost with xampp. Yesterday during some tests, I accidentally changed site's URL from http://localhost/testsite to http://localhost, that might have messed up something inside xampp's project management system, because I immediately lost access to my site. I was able to fix it by manually changing back the site and homepage URLs in the database, but then I found something weird happening.

Let's say my testsite web is located in C:\xampp\htdocs\testsite. So now, I have an .htaccess file in C:\, and if I delete it, all my pages now except homepage return 404. I can restore the file going to Settings->Permalinks and saving changes, but the .htaccess file this operation generates still shows up in C:\ folder instead of C:\xampp\htdocs\testsite.

Is there any way to tell xampp where to look for that .htaccess file or should I just backup my db and website files, and reinstall xampp, and, if so, what steps should I follow to ensure not missing anything important that might cause trouble later on?

CodePudding user response:

Update:

I ended up backing up my db and theme, completely uninstalling and installing xampp again, then installing WordPress, adding my saved theme, importing the db, and regenerating the .htaccess file within the permalink section in settings, it now works fine and the file is where it's supposed to be.

I'm pretty sure there was an easier and faster way to do this, but I couldn't find it and this worked anyway.

  • Related