{"id":526,"date":"2021-08-21T16:59:29","date_gmt":"2021-08-21T11:29:29","guid":{"rendered":"https:\/\/blog.al-zakirah202.familyds.com\/?p=526"},"modified":"2021-08-21T16:59:29","modified_gmt":"2021-08-21T11:29:29","slug":"fix-404-page-not-found-error","status":"publish","type":"post","link":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/2021\/08\/21\/fix-404-page-not-found-error\/","title":{"rendered":"Fix: 404 page not found error"},"content":{"rendered":"<p>There are various reasons why the blog pages start throwing &#8216;404 &#8211; page not found error&#8217;. \u00a0They potentially start to surface post a version update of the either the server which&#8217;s running the software like WordPress used for creating blogs or post an update to blogging software itself. \u00a0We&#8217;ll try to <!--more-->explore some of the most common causes and the potential fixes. \u00a0Please note that the options being explored in the post are specific to WordPress which&#8217;s open source blogging platform.<\/p>\r\n<p>There are primarily 2 main reasons for the dreaded 404 error,<\/p>\r\n<ol>\r\n<li>The missing &#8216;<em>.httaccess<\/em>&#8216; file in the root directory of the WordPress<\/li>\r\n<li>Issues with &#8216;Permalinks&#8217; which&#8217;s making the page inaccessible<\/li>\r\n<\/ol>\r\n<h3>The .httaccess file:<\/h3>\r\n<p>You need to logon to your WordPress account with your root credentials and access the parent directory of the WordPress. \u00a0For example, on a Synology running DSM7.0, the &#8216;wordpress&#8217; directory can be found under &#8220;web_packages&#8217; folder. \u00a0Obviously, you would need to login to Synology with admin credentials to access the wordpress folder. \u00a0In the folder look for the file <em>&#8216;.httaccess&#8217;<\/em> file and if it&#8217;s present ensure the contents are as shown below else create a file with the contents matching the below contents. \u00a0And ensure to name the file <em>&#8216;.httaccess&#8217;\u00a0<\/em>(notice the presence of &#8216;.&#8217; at the beginning of the file name).<\/p>\r\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&amp;lt;IfModule mod_rewrite.c&amp;gt;\r\nRewriteEngine On\r\nRewriteRule .* - &#x5B;E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]\r\nRewriteBase \/\r\nRewriteRule ^index\\.php$ - &#x5B;L]\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !-d\r\nRewriteRule . \/index.php &#x5B;L]\r\n&amp;lt;\/IfModule&amp;gt;\r\n<\/pre><\/div>\r\n<p>This should resolve the 404 error when you try to access the blog page now. \u00a0If it does give this post a \ud83d\udc4d, else continue to read..<\/p>\r\n<h3>The Premalinks:<\/h3>\r\n<p>Login to your WordPress using the admin credentials and access S<em>ettings -&gt; Permalinks<\/em><\/p>\r\n<div id=\"attachment_531\" style=\"width: 652px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-531\" src=\"https:\/\/blog.al-zakirah202.familyds.com\/wp-content\/uploads\/2021\/08\/Screenshot-2021-08-21-at-4.29.15-PM.png\" alt=\"\" width=\"642\" height=\"564\" class=\"size-full wp-image-531\" srcset=\"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/08\/Screenshot-2021-08-21-at-4.29.15-PM.png 642w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/08\/Screenshot-2021-08-21-at-4.29.15-PM-300x264.png 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><p id=\"caption-attachment-531\" class=\"wp-caption-text\">Settings -&gt; Permalinks<\/p><\/div>\r\n<ul>\r\n<li>The first step to try is to just hit the\u00a0<em>&#8216;save changes&#8217;<\/em>\u00a0button to save the current settings on the Permalinks page (yes, just hit the <em>&#8216;save changes&#8217;<\/em> button without making any changes). \u00a0This should trigger the rewrite rules and also create\/update the <em>&#8216;.httaccess&#8217;<\/em> file if it&#8217;s missing or damaged. \u00a0And see if this resolves the problem<\/li>\r\n<\/ul>\r\n<div id=\"attachment_533\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-533\" src=\"https:\/\/blog.al-zakirah202.familyds.com\/wp-content\/uploads\/2021\/08\/Screenshot-2021-08-21-at-4.34.32-PM-1024x545.png\" alt=\"\" width=\"800\" height=\"426\" class=\"size-large wp-image-533\" srcset=\"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/08\/Screenshot-2021-08-21-at-4.34.32-PM-1024x545.png 1024w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/08\/Screenshot-2021-08-21-at-4.34.32-PM-300x160.png 300w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/08\/Screenshot-2021-08-21-at-4.34.32-PM-768x409.png 768w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/08\/Screenshot-2021-08-21-at-4.34.32-PM-1536x818.png 1536w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/08\/Screenshot-2021-08-21-at-4.34.32-PM-2048x1090.png 2048w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><p id=\"caption-attachment-533\" class=\"wp-caption-text\">Saving the Permalinks<\/p><\/div>\r\n<ul>\r\n<li>If the step above didn&#8217;t yield the expected result then try to select any other format for the Permalinks other than what you currently selected. \u00a0For example, you could change from the format &#8220;Day and name&#8221; (see picture above) to &#8220;Month and name&#8221; (say) or a custom format where you could define based on your requirements. \u00a0And hit <em>&#8216;save changes&#8217;<\/em>. \u00a0This should address the problem if it&#8217;s due to unsupported Permalinks format tag.<\/li>\r\n<\/ul>\r\n<h3>Summary:<\/h3>\r\n<p>The above steps should resolve the problem in most of the cases, however, if you still continue to see the issue, you need to seriously look at the database (for example, the &#8216;Maria db&#8217; if you are using it) is corrupted and needs a repair. \u00a0You can use the PhpmyAdmin software to repair the Maria db database if it&#8217;s broken.<\/p>\r\n<p>The issue in one of the cases was that when one of the users migrated form Synology DSM 6+ to DSM 7 and he had custom format selected for the Permalinks. \u00a0On DSM 6+, the Permalinks custom format had &#8220;index.php&#8221; word before the year, month, day &amp; post name tags. \u00a0While it worked perfectly fine on DSM6+ but, on DSM7 it started throwing the &#8216;404&#8217; error. \u00a0And the trick\/steps proposed above helped (specifically the 2nd step) to resolve the Premalinks issue and bring his website back online.<\/p>\r\n<p>Please feel free to comment and provide feedback on the post. \u00a0Also, write to us if you need any help in fixing the 404 error on your website!<\/p><div id=\"emojics-root\"><\/div><div class=\"remoji_bar\"><div class=\"remoji_add_container\" data-remoji-id=\"526\" data-remoji-type=\"post\"><div class=\"remoji_add_icon\"><\/div><\/div><div class=\"remoji_error_bar\" data-remoji-id=\"526\" data-remoji-type=\"post\" style=\"display: none;\">Error happened.<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>There are various reasons why the blog pages start throwing &#8216;404 &#8211; page not found error&#8217;. \u00a0They potentially start to surface post a version update of the either the server which&#8217;s running the software like WordPress used for creating blogs or post an update to blogging software itself. \u00a0We&#8217;ll try to Error happened.<\/p>\n","protected":false},"author":1,"featured_media":527,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,31],"tags":[32],"class_list":["post-526","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","category-wordpress","tag-404-error"],"_links":{"self":[{"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/posts\/526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=526"}],"version-history":[{"count":5,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/posts\/526\/revisions"}],"predecessor-version":[{"id":534,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/posts\/526\/revisions\/534"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/media\/527"}],"wp:attachment":[{"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}