Forum Moderators: phranque
In .htaccess, I am using:
ErrorDocument 404 /missing.html
When a page is not found, they are directed to missing.html
This works in that missing.html is displayed when a page is not found. Additionally, in the title bar of my browser, a 404 error is displayed when I am directed to missing.html.
I checked to see if this is working using a header checker tool and now I am not sure if this is working.
I wanted to use the header checker tool at searchengineworld (webmasterworld) but that tool is no longer accessible, so I used a couple of other tools instead.
One tool, showed me two responses. The first response was a 301 response and second response was a 404 error code. I don't know why there were two responses or what two responses mean.
The second tool showed only one response, a 301 response.
I thought I was doing this right but I don't think I am anymore.
Can anyone explain why the first tool showed two responses? Am I doing this right, what about the 404?
Thanks.
The observations above no longer hold true. I am seeing the proper 404 response on both tools. I believe I was seeing wrong data temporarily as I was trying something else... which leads to the question I had at first.
I would like to use .htaccess to display a 410 response (permanently gone) but then direct to /missing.html.
I thought this would have worked:
ErrorDocument 410 /missing.html
but it does not work.
Can anyone let me know how to use .htaccess to display a 410 response but direct to missing.html.
Thanks.
Redirect 410 /URL-path-to-removed-file
RewriteRule ^URL-path-to-removed-file$ - [G]
Jim
First, do these lines go in .htaccess (or do they have to go in httpd.conf, I would like to use .htaccess)?
I also don't understand how the server is directing the user to /missing.html as that is not shown in the two lines above.
Say I have two directories that are both now gone, would I do something like this in .htaccess work?
Redirect 410 /directory-1/
Redirect 410 /directory-2/
If so, how is that directed to /missing.html
Please bear with me, this is foreign to me.
Thanks.