PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, March 12, 2022

[FIXED] WordPress on Xampp has it's .htaccess file outside xampp's installation folder

 March 12, 2022     .htaccess, apache, wordpress, xampp     No comments   

Issue

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?


Solution

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.



Answered By - Martin
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing