{"id":2227,"date":"2024-09-14T06:47:40","date_gmt":"2024-09-14T06:47:40","guid":{"rendered":"https:\/\/www.devopssupport.in\/blog\/?p=2227"},"modified":"2024-09-14T07:35:18","modified_gmt":"2024-09-14T07:35:18","slug":"apache-the-requested-url-was-not-found-on-this-server","status":"publish","type":"post","link":"https:\/\/www.devopssupport.in\/blog\/apache-the-requested-url-was-not-found-on-this-server\/","title":{"rendered":"Apache: The requested URL was not found on this server"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"843\" height=\"252\" src=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2024\/09\/image-6.png\" alt=\"\" class=\"wp-image-2229\" srcset=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2024\/09\/image-6.png 843w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2024\/09\/image-6-300x90.png 300w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2024\/09\/image-6-768x230.png 768w\" sizes=\"auto, (max-width: 843px) 100vw, 843px\" \/><\/figure>\n\n\n\n<p><strong>Not Found<\/strong><br>The requested URL was not found on this server.<br><em>Apache\/2.4.58 (Win64) OpenSSL\/3.1.3 PHP\/8.2.12 Server at name Port 443<\/em><\/p>\n\n\n\n<p>If you&#8217;ve encountered this error while working on your local server setup or even on a production environment, here\u2019s how you can resolve it.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Solution:<\/strong><\/h4>\n\n\n\n<p>This error typically means that Apache couldn\u2019t find the file or directory you\u2019re trying to access. Let\u2019s go through a step-by-step process to troubleshoot and resolve the issue.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. <strong>Check the URL<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, make sure that the URL you\u2019re trying to access is correct. Even a small typo in the URL can lead to this error.<\/li>\n\n\n\n<li>Ensure that the file or directory exists in the location specified by the URL. For instance, if you\u2019re trying to access <code>http:\/\/localhost\/example\/index.php<\/code>, make sure the <code>index.php<\/code> file exists inside the <code>example<\/code> directory.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. <strong>Directory Indexing Configuration<\/strong><\/h4>\n\n\n\n<p>If you are accessing a directory without specifying a file (like <code>http:\/\/localhost\/example\/<\/code>), Apache will try to load a default file (like <code>index.php<\/code> or <code>index.html<\/code>). If such a file doesn\u2019t exist, you might get the &#8220;Not Found&#8221; error.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open your Apache configuration file (<code>httpd.conf<\/code>).<\/li>\n\n\n\n<li>Look for the line that defines the <code>DirectoryIndex<\/code>, which specifies the default files that Apache looks for in a directory. It should look something like this:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>DirectoryIndex index.php index.html<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If this line is missing or doesn\u2019t include the file type you are trying to load, add it and restart Apache.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">3. <strong>Check File Permissions<\/strong><\/h4>\n\n\n\n<p>Sometimes, the &#8220;Not Found&#8221; error can be caused by permission issues. Apache needs the appropriate permissions to read the files and directories on your server.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ensure that your files and directories have the correct permissions. On Linux, the <code>chmod<\/code> command can be used to adjust file permissions:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod 755 \/path\/to\/your\/directory\nsudo chmod 644 \/path\/to\/your\/file.php\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>On Windows, make sure that the Apache service has access to the necessary files.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4. <strong>Check Apache\u2019s <code>DocumentRoot<\/code><\/strong><\/h4>\n\n\n\n<p>Apache serves files from a specific directory, known as the <code>DocumentRoot<\/code>. If your files are not placed in the correct location or if the <code>DocumentRoot<\/code> is incorrectly configured, you will get a &#8220;Not Found&#8221; error.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open your <code>httpd.conf<\/code> file and look for the <code>DocumentRoot<\/code> directive. It might look something like this:<\/li>\n<\/ul>\n\n\n\n<p>DocumentRoot &#8220;C:\/xampp\/htdocs&#8221;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ensure that the file you\u2019re trying to access is within the directory specified by <code>DocumentRoot<\/code>.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">5. <strong>Check Virtual Hosts Configuration<\/strong><\/h4>\n\n\n\n<p>If you\u2019re using virtual hosts (multiple sites running on the same server), an incorrectly configured virtual host can lead to a &#8220;Not Found&#8221; error.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open your virtual hosts configuration file (often found in <code>conf\/extra\/httpd-vhosts.conf<\/code> or similar).<\/li>\n\n\n\n<li>Ensure that the <code>ServerName<\/code> and <code>DocumentRoot<\/code> are correctly set for the site you are trying to access. Example:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:443&gt;\n    ServerName name\n    DocumentRoot \"C:\/path\/to\/your\/site\"\n    SSLEngine on\n    SSLCertificateFile \"C:\/path\/to\/ssl\/certificate.crt\"\n    SSLCertificateKeyFile \"C:\/path\/to\/ssl\/private.key\"\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n\n\n\n<p>Also, verify that the virtual host configuration is included in your main Apache configuration file (<code>httpd.conf<\/code>), like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Include conf\/extra\/httpd-vhosts.conf\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">6. <strong>Restart Apache<\/strong><\/h4>\n\n\n\n<p>After making any changes to your configuration files, restart the Apache server to apply the changes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>On Windows (if using XAMPP or WAMP), you can stop and start the Apache service through the control panel.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart apache2<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>More topics on Bug fixing:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devops-support wp-block-embed-devops-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"UlaT6xEwJX\"><a href=\"https:\/\/www.devopssupport.in\/blog\/mysql-error-1932-table-doesnt-exist-in-engine\/\">MySQL Error #1932: &#8220;Table Doesn&#8217;t Exist in Engine&#8221;<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;MySQL Error #1932: &#8220;Table Doesn&#8217;t Exist in Engine&#8221;&#8221; &#8212; DevOps Support\" src=\"https:\/\/www.devopssupport.in\/blog\/mysql-error-1932-table-doesnt-exist-in-engine\/embed\/#?secret=iiCj1wdZxI#?secret=UlaT6xEwJX\" data-secret=\"UlaT6xEwJX\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devops-support wp-block-embed-devops-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"LvhTM3qN6w\"><a href=\"https:\/\/www.devopssupport.in\/blog\/neterr_incomplete_chunked_encoding-200-ok\/\">net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)&#8221; &#8212; DevOps Support\" src=\"https:\/\/www.devopssupport.in\/blog\/neterr_incomplete_chunked_encoding-200-ok\/embed\/#?secret=PmXqjZdiHh#?secret=LvhTM3qN6w\" data-secret=\"LvhTM3qN6w\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devops-support wp-block-embed-devops-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"fjGbvnQFOv\"><a href=\"https:\/\/www.devopssupport.in\/blog\/fixing-429-too-many-requests-in-laravel\/\">Fixing 429 Too Many Requests in Laravel<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Fixing 429 Too Many Requests in Laravel&#8221; &#8212; DevOps Support\" src=\"https:\/\/www.devopssupport.in\/blog\/fixing-429-too-many-requests-in-laravel\/embed\/#?secret=lczAAIvLYa#?secret=fjGbvnQFOv\" data-secret=\"fjGbvnQFOv\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devops-support wp-block-embed-devops-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"wLFzeYO4o4\"><a href=\"https:\/\/www.devopssupport.in\/blog\/1834-2\/\">Resolving the &#8216;type &#8216;Null&#8217; is not a subtype of type &#8216;String&#8221; Error in Flutter<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Resolving the &#8216;type &#8216;Null&#8217; is not a subtype of type &#8216;String&#8221; Error in Flutter&#8221; &#8212; DevOps Support\" src=\"https:\/\/www.devopssupport.in\/blog\/1834-2\/embed\/#?secret=cVDxkxZsv7#?secret=wLFzeYO4o4\" data-secret=\"wLFzeYO4o4\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devops-support wp-block-embed-devops-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"TOPt9zrFL5\"><a href=\"https:\/\/www.devopssupport.in\/blog\/solving-the-libandroid-emu-metrics-dll-not-found-error-in-android-development\/\">Solving the \u201clibandroid-emu-metrics.dll Not Found\u201d Error in Android Development<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Solving the \u201clibandroid-emu-metrics.dll Not Found\u201d Error in Android Development&#8221; &#8212; DevOps Support\" src=\"https:\/\/www.devopssupport.in\/blog\/solving-the-libandroid-emu-metrics-dll-not-found-error-in-android-development\/embed\/#?secret=b08isubDSs#?secret=TOPt9zrFL5\" data-secret=\"TOPt9zrFL5\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devops-support wp-block-embed-devops-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"PnJNCZs7w6\"><a href=\"https:\/\/www.devopssupport.in\/blog\/resolving-flutter-target-file-lib-main-dart-not-found-issue\/\">Resolving &#8220;Flutter: Target file &#8216;lib\/main.dart&#8217; not found&#8221; Issue<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Resolving &#8220;Flutter: Target file &#8216;lib\/main.dart&#8217; not found&#8221; Issue&#8221; &#8212; DevOps Support\" src=\"https:\/\/www.devopssupport.in\/blog\/resolving-flutter-target-file-lib-main-dart-not-found-issue\/embed\/#?secret=fKgo5iaZr9#?secret=PnJNCZs7w6\" data-secret=\"PnJNCZs7w6\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devops-support wp-block-embed-devops-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"EUTkLvIQaH\"><a href=\"https:\/\/www.devopssupport.in\/blog\/troubleshooting-laravel-laravel-emergency-unable-to-create-configured-logger-using-emergency-logger\/\">Troubleshooting Laravel: &#8220;laravel.EMERGENCY: Unable to create configured logger. Using emergency logger.&#8221;<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Troubleshooting Laravel: &#8220;laravel.EMERGENCY: Unable to create configured logger. Using emergency logger.&#8221;&#8221; &#8212; DevOps Support\" src=\"https:\/\/www.devopssupport.in\/blog\/troubleshooting-laravel-laravel-emergency-unable-to-create-configured-logger-using-emergency-logger\/embed\/#?secret=8Gm3daO3Zl#?secret=EUTkLvIQaH\" data-secret=\"EUTkLvIQaH\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devops-support wp-block-embed-devops-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"cFmxBKQf2m\"><a href=\"https:\/\/www.devopssupport.in\/blog\/type-null-is-not-a-subtype-of-type-string-errors\/\">&#8216;type &#8216;Null&#8217; is not a subtype of type &#8216;String&#8217; Errors<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;&#8216;type &#8216;Null&#8217; is not a subtype of type &#8216;String&#8217; Errors&#8221; &#8212; DevOps Support\" src=\"https:\/\/www.devopssupport.in\/blog\/type-null-is-not-a-subtype-of-type-string-errors\/embed\/#?secret=K2DJDV7rQD#?secret=cFmxBKQf2m\" data-secret=\"cFmxBKQf2m\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devops-support wp-block-embed-devops-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"a6R5zG3e6n\"><a href=\"https:\/\/www.devopssupport.in\/blog\/building-elegant-multiple-select-dropdown-lists-in-flutter\/\">Building Elegant Multiple Select Dropdown Lists in Flutter<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Building Elegant Multiple Select Dropdown Lists in Flutter&#8221; &#8212; DevOps Support\" src=\"https:\/\/www.devopssupport.in\/blog\/building-elegant-multiple-select-dropdown-lists-in-flutter\/embed\/#?secret=1jTp4pZr3u#?secret=a6R5zG3e6n\" data-secret=\"a6R5zG3e6n\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devops-support wp-block-embed-devops-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"Mx23QEwOrM\"><a href=\"https:\/\/www.devopssupport.in\/blog\/platformexception-read_external_storage_denied-in-flutter\/\">PlatformException: read_external_storage_denied in Flutter<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;PlatformException: read_external_storage_denied in Flutter&#8221; &#8212; DevOps Support\" src=\"https:\/\/www.devopssupport.in\/blog\/platformexception-read_external_storage_denied-in-flutter\/embed\/#?secret=73HHAXEjJK#?secret=Mx23QEwOrM\" data-secret=\"Mx23QEwOrM\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Not FoundThe requested URL was not found on this server.Apache\/2.4.58 (Win64) OpenSSL\/3.1.3 PHP\/8.2.12 Server at name Port 443 If you&#8217;ve encountered this error while working on your&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2011,2024,2012,2026,2017,2025,2019,2010,2022,2015,2023,2018,2021,2020,2016,586,2014,2013,57],"class_list":["post-2227","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-apache-404-error","tag-apache-443-error","tag-apache-configuration","tag-apache-directory-indexing","tag-apache-document-root","tag-apache-php-error","tag-apache-restart","tag-apache-server-error","tag-apache-ssl-configuration","tag-apache-virtual-host-configuration","tag-apache-windows-error","tag-file-permissions-apache","tag-fixing-apache-errors","tag-localhost-not-found","tag-mod_rewrite","tag-not-found-error","tag-server-error-solution","tag-troubleshooting-apache","tag-url-not-found"],"_links":{"self":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/2227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/comments?post=2227"}],"version-history":[{"count":2,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/2227\/revisions"}],"predecessor-version":[{"id":2272,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/2227\/revisions\/2272"}],"wp:attachment":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/media?parent=2227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/categories?post=2227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/tags?post=2227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}