404 not found error: what it is and how to fix it

     

When it comes to developing WordPress in a local environment, XAMPP is a popular and trusted tool. However, that doesn’t mean you won’t ever run into errors. One you might come across is the HTTP error 404 “The requested resource is not found.”


See how jdomain.vn stacks up against the competition. Select your provider WP Engine SiteGround GoDaddy Bluehost Flywheel HostGator Cloudways AWS Digital Ocean DreamHost Other Compare

If you encounter this issue, there are several ways to try to lớn resolve it. These fixes aren’t overly complicated & don’t take a lot of time to perform. With a little patience, you should be back up and running in no time. In this article, we’ll explain what the error “requested resource is not found” in XAMPP is. Then, we’ll cốt truyện five tips for how lớn fix the problem and get you back on track.

Bạn đang xem: 404 not found error: what it is and how to fix it


What the XAMPP HTTP Error 404 “The Requested Resource Is Not Found” Means

A 404 error is one of many HTTP status codes that are sent from a server to a client. In general, this error indicates that the browser is requesting something that can’t be found on the server.

*
An HTTP 404 error.

It can be challenging to determine the source of a 404 error, as there are several potential causes. These can include:

The tên miền no longer exists.The requested resource has been deleted or moved lớn a different URL.The URL was mistyped into the browser.

You’ve likely run into these situations when browsing the web. However, you can encounter 404 errors when working on localhost with XAMPP as well. In this case, you may also see the message expressed as Error 404 “the object is not found.”

Info

Looking for a powerful tool for local WordPress development? Devjdomain.vn features one-click site creation, built-in HTTPS, powerful email and database management tools, and more. Learn more about Devjdomain.vn!

How khổng lồ Fix the HTTP Error 404 “The Requested Resource Is Not Found” in XAMPP (5 Tips)

Now that you understand what this particular XAMPP error is, let’s explore how khổng lồ fix it using the following five tips.

1. Be Sure You Typed the URL Correctly

Before you attempt any other fixes, we recommend double-checking that you haven’t mistyped or included anything unnecessary in the URL. For example, a common mistake is including “XAMPP” when it’s not needed:

*
An example of mistyped localhost URL.

Errant keystrokes are a frequent cause of this error but are also easy khổng lồ fix. If you’re sure you’ve entered the correct URL & are still having problems, there are a few other solutions you can try.

2. Check Your .htaccess File

A missing .htaccess file can also cause a 404 error. Therefore, it’s important khổng lồ be sure the file exists in the correct location, especially if you see the “the object is not found” version of the error.

To find the file, you can navigate to lớn the XAMPP folder on your computer. Within this folder, there will be another one called htdocs. This folder is likely where you installed WordPress when you initially phối up your website. You should find the .htaccess file there:

*
The location of the .htaccess file.

If you are using a macOS, the tệp tin will still be in the htdocs folder. However, you’ll find it via Applications > Xampp > xamppfiles > htdocs.

If the tệp tin doesn’t exist, you’ll need to lớn create one. To vày this, open your preferred text editor và name the tệp tin “.htaccess”. The exact code you need khổng lồ paste into it may vary depending on your setup, but it should look something like this:

# BEGIN WordPressRewriteEngine OnRewriteRule .* - RewriteBase /RewriteRule ^index.php$ - RewriteCond %REQUEST_FILENAME !-fRewriteCond %REQUEST_FILENAME !-dRewriteRule . /index.php # kết thúc WordPressSave the file to the folder you created for your website. Even if you don’t discover an obvious problem with your .htaccess file, sometimes simply replacing it with a fresh one can fix the error.

3. Deactivate & Uninstall New Plugins

When you install plugins, they may make changes lớn your code or database that can cause this 404 error. Starting with your newer plugins, you can try deactivating or uninstalling them khổng lồ see if that fixes the problem.

Plugins can be deactivated from the admin dashboard of your local site. To vày so, in the thực đơn on the left of the screen, click on Plugins > Installed Plugins. To deactivate one, click on the Deactivate link under the name of the plugin:

*
Deactivating a WordPress plugin.

If you want to uninstall a plugin completely, you can vì so from the same screen. First, deactivate the plugin, then click on the red Delete link that below the name of the plugin:

*
The option to lớn delete a plugin after you’ve deactivated it.

Even if you haven’t installed any plugins recently, this is worth trying, since updates to plugins can sometimes cause problems. You can also deactivate all of your plugins at once by renaming the plugins folder in your site’s directory.


4. Check Your Database for Changes

Even if you uninstall a problematic plugin, the changes it made to lớn your site may continue lớn cause issues. If you suspect this is the case, you may want to check your local site’s database for changes.

To access the database, you can type http://localhost/phpmyadmin into your browser. Alternatively, from the XAMPP control panel, you can click on the Admin button next lớn MySQL to open phpMyAdmin.

Xem thêm: Sữa Lỗi Không Mở Được Folder Khi Kich Đúp Chuột, Lỗi Không Mở Được My Computer Và Các Thư Mục

*
You can xuất hiện phpMyAdmin from the XAMPP control panel.

Now you can click on the Databases tab at the đứng đầu of the screen. Locate your website’s database in the list to view the tables it contains:

*
The default WordPress database tables.

Next, you’ll want khổng lồ comb through the database & look for anything that shouldn’t be there. Some plugins will add entirely new tables khổng lồ your database. Khổng lồ remove an unnecessary table, click on the Drop link to lớn its right:

*
Removing tables from a WordPress database.

Most plugins will make changes to lớn the wp_options table, so you’ll want to lớn have a look at that entry. You can also check the bộ vi xử lý core WordPress tables. While plugins shouldn’t change these tables, it is possible, especially if you installed a nulled plugin.

If you’re unsure what your database or tables are supposed lớn look like, you may want lớn create a new WordPress site. Then you can compare the fresh database to lớn yours.


5. Check Your Apache Configuration

If you’re having trouble opening a PHP file, your Apache configuration could be incorrect. More specifically, there may be a conflict with the port that Apache is trying to lớn use.

Apache uses port 80 by default, but you may need lớn change it if you already have something listening on that port. To lớn find a free port, you can click on the Netstat button in the XAMPP control panel:

*
A danh mục of ports in Netstat.

If port 80 is already in use, or if you just prefer to leave it open, you can go ahead và choose a free port number. We’ll use “8080” for this example, but you can use whichever port you’d like.

Next, you’ll need lớn edit the httpd.conf file. You can find it in C:xamppapacheconfig if you’re using Windows:

*
The httpd tệp tin location in Windows.

If you’re working on macOS, you can find this file in the /etc/apache2 directory. You can locate it using the Go to lớn Folder option in Finder.

Once you’ve found the file, go ahead and open it in your preferred text editor. There are two lines you’ll need khổng lồ edit:

Listen 80ServerName localhost:80Change the Listen port number lớn 8080 và the ServerName to localhost:8080. Now you can save và close the file.

At this point, you can restart the Apache server và attempt to lớn access localhost:8080 (or whichever port you’re using) in your browser. If you’re not successful, you’ll need khổng lồ edit the http-ssl.conf file. Windows users can find this file in xamppapacheconfextra.

*
The httpd-ssl tệp tin location in Windows.

Once again, you should be able to lớn locate this file on a macOS by typing /etc/apache2 into Finder’s Go to Folder.

Once located, you can xuất hiện the tệp tin in a text editor. There are three lines that you’ll need khổng lồ update in this file:

Listen 443ServerName localhost:443Locate each of these lines in the file & change the values khổng lồ “8080”. After saving the file, you can restart the Apache hệ thống again. Now you should be able to lớn access localhost:8080 in your browser.

Summary

The “requested resource is not found” error can undoubtedly slow you down when you’re working with XAMPP. There are a few possible causes for this issue. Fortunately, the solutions for resolving it aren’t complicated.

In this post, we covered a few ways you can attempt to fix the XAMPP Error 404. You can start by ensuring that you’ve entered the URL correctly, & move on from there. With any luck, you’ll be back khổng lồ work in no time.

If you enjoyed this tutorial, then you’ll love our support. All jdomain.vn’s hosting plans include 24/7 tư vấn from our veteran WordPress developers và engineers. Check out our plans today to learn more!


Save time, costs và maximize site performance with:

Instant help from WordPress hosting experts, 24/7.Cloudflare Enterprise integration.Global audience reach with 32 data centers worldwide.Optimization with our built-in Application Performance Monitoring.

All of that and much more, in one plan with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Kiểm tra out our plans or talk lớn sales lớn find the plan that’s right for you.


Chuyên mục: Domain Hosting