Redirecting 404 [Not Found] Error To Homepage And Before Redirecting To Home Page, Tell Search Engines 404...












0















I googled and searched on stack over flow but i not found my answer.
in Google webmaster Tools, My site have 58,842 Not Found[404] URL Errors. I want all 404 pages redirect to home page with 410 status code using the .htaccess file. I mean before redirecting to home page, I want visitors or Search Engines redirected to home page and get 410 status code. I want tell to Search Engines that, the 404 page was permanently deleted[410] and redirect to home page. For example...



step-1 Visitors or Search Engines visits this url. this is 404 page.
https://example.com/some-url-of-my-blog



step-2 Search Engines get HTTP/1.1 410 Gone [status code 410]

step-3 Visitors or Search Engines redirected to home page. That's it.



Is it possible in .htaccess file. Please anyone solve this.










share|improve this question



























    0















    I googled and searched on stack over flow but i not found my answer.
    in Google webmaster Tools, My site have 58,842 Not Found[404] URL Errors. I want all 404 pages redirect to home page with 410 status code using the .htaccess file. I mean before redirecting to home page, I want visitors or Search Engines redirected to home page and get 410 status code. I want tell to Search Engines that, the 404 page was permanently deleted[410] and redirect to home page. For example...



    step-1 Visitors or Search Engines visits this url. this is 404 page.
    https://example.com/some-url-of-my-blog



    step-2 Search Engines get HTTP/1.1 410 Gone [status code 410]

    step-3 Visitors or Search Engines redirected to home page. That's it.



    Is it possible in .htaccess file. Please anyone solve this.










    share|improve this question

























      0












      0








      0








      I googled and searched on stack over flow but i not found my answer.
      in Google webmaster Tools, My site have 58,842 Not Found[404] URL Errors. I want all 404 pages redirect to home page with 410 status code using the .htaccess file. I mean before redirecting to home page, I want visitors or Search Engines redirected to home page and get 410 status code. I want tell to Search Engines that, the 404 page was permanently deleted[410] and redirect to home page. For example...



      step-1 Visitors or Search Engines visits this url. this is 404 page.
      https://example.com/some-url-of-my-blog



      step-2 Search Engines get HTTP/1.1 410 Gone [status code 410]

      step-3 Visitors or Search Engines redirected to home page. That's it.



      Is it possible in .htaccess file. Please anyone solve this.










      share|improve this question














      I googled and searched on stack over flow but i not found my answer.
      in Google webmaster Tools, My site have 58,842 Not Found[404] URL Errors. I want all 404 pages redirect to home page with 410 status code using the .htaccess file. I mean before redirecting to home page, I want visitors or Search Engines redirected to home page and get 410 status code. I want tell to Search Engines that, the 404 page was permanently deleted[410] and redirect to home page. For example...



      step-1 Visitors or Search Engines visits this url. this is 404 page.
      https://example.com/some-url-of-my-blog



      step-2 Search Engines get HTTP/1.1 410 Gone [status code 410]

      step-3 Visitors or Search Engines redirected to home page. That's it.



      Is it possible in .htaccess file. Please anyone solve this.







      .htaccess redirect http-status-code-404 http-status-code-410






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 '18 at 13:23









      Gul NoorGul Noor

      104




      104
























          1 Answer
          1






          active

          oldest

          votes


















          0














          It sounds like you are really just wanting the 410 redirect on any pages and directories that do not exist.



          For most cases something like this should work fine



          RewriteEngine on
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ / [L,R=410]





          share|improve this answer
























          • But I also want 410 redirect to home page. 1st tells to search engine that the 404 page is gone [HTTP Status code is 410] and then 410 redirect to homepage.

            – Gul Noor
            Nov 24 '18 at 3:59













          • I want more to clearly explain it. 1-Server send 410 status code [to the browser or crawler] for 404 error page and then 410 error page redirect the browser or search crawler to the home page.

            – Gul Noor
            Nov 24 '18 at 4:23














          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53447528%2fredirecting-404-not-found-error-to-homepage-and-before-redirecting-to-home-pag%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          It sounds like you are really just wanting the 410 redirect on any pages and directories that do not exist.



          For most cases something like this should work fine



          RewriteEngine on
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ / [L,R=410]





          share|improve this answer
























          • But I also want 410 redirect to home page. 1st tells to search engine that the 404 page is gone [HTTP Status code is 410] and then 410 redirect to homepage.

            – Gul Noor
            Nov 24 '18 at 3:59













          • I want more to clearly explain it. 1-Server send 410 status code [to the browser or crawler] for 404 error page and then 410 error page redirect the browser or search crawler to the home page.

            – Gul Noor
            Nov 24 '18 at 4:23


















          0














          It sounds like you are really just wanting the 410 redirect on any pages and directories that do not exist.



          For most cases something like this should work fine



          RewriteEngine on
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ / [L,R=410]





          share|improve this answer
























          • But I also want 410 redirect to home page. 1st tells to search engine that the 404 page is gone [HTTP Status code is 410] and then 410 redirect to homepage.

            – Gul Noor
            Nov 24 '18 at 3:59













          • I want more to clearly explain it. 1-Server send 410 status code [to the browser or crawler] for 404 error page and then 410 error page redirect the browser or search crawler to the home page.

            – Gul Noor
            Nov 24 '18 at 4:23
















          0












          0








          0







          It sounds like you are really just wanting the 410 redirect on any pages and directories that do not exist.



          For most cases something like this should work fine



          RewriteEngine on
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ / [L,R=410]





          share|improve this answer













          It sounds like you are really just wanting the 410 redirect on any pages and directories that do not exist.



          For most cases something like this should work fine



          RewriteEngine on
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ / [L,R=410]






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 23 '18 at 13:53









          WiththeWindWiththeWind

          744




          744













          • But I also want 410 redirect to home page. 1st tells to search engine that the 404 page is gone [HTTP Status code is 410] and then 410 redirect to homepage.

            – Gul Noor
            Nov 24 '18 at 3:59













          • I want more to clearly explain it. 1-Server send 410 status code [to the browser or crawler] for 404 error page and then 410 error page redirect the browser or search crawler to the home page.

            – Gul Noor
            Nov 24 '18 at 4:23





















          • But I also want 410 redirect to home page. 1st tells to search engine that the 404 page is gone [HTTP Status code is 410] and then 410 redirect to homepage.

            – Gul Noor
            Nov 24 '18 at 3:59













          • I want more to clearly explain it. 1-Server send 410 status code [to the browser or crawler] for 404 error page and then 410 error page redirect the browser or search crawler to the home page.

            – Gul Noor
            Nov 24 '18 at 4:23



















          But I also want 410 redirect to home page. 1st tells to search engine that the 404 page is gone [HTTP Status code is 410] and then 410 redirect to homepage.

          – Gul Noor
          Nov 24 '18 at 3:59







          But I also want 410 redirect to home page. 1st tells to search engine that the 404 page is gone [HTTP Status code is 410] and then 410 redirect to homepage.

          – Gul Noor
          Nov 24 '18 at 3:59















          I want more to clearly explain it. 1-Server send 410 status code [to the browser or crawler] for 404 error page and then 410 error page redirect the browser or search crawler to the home page.

          – Gul Noor
          Nov 24 '18 at 4:23







          I want more to clearly explain it. 1-Server send 410 status code [to the browser or crawler] for 404 error page and then 410 error page redirect the browser or search crawler to the home page.

          – Gul Noor
          Nov 24 '18 at 4:23






















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53447528%2fredirecting-404-not-found-error-to-homepage-and-before-redirecting-to-home-pag%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini