Redirecting 404 [Not Found] Error To Homepage And Before Redirecting To Home Page, Tell Search Engines 404...
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
add a comment |
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
add a comment |
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
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
.htaccess redirect http-status-code-404 http-status-code-410
asked Nov 23 '18 at 13:23
Gul NoorGul Noor
104
104
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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]
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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]
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
add a comment |
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]
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
add a comment |
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]
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]
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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