Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I redirect nonexistent pages to the 404 error page with .htaccess?
    text
    copied!<p>Apparently Bingbot is getting caught in an infinite loop on my site. It downloads pages like <a href="http://www.htmlcodetutorial.com/quicklist.html/applets/applets/applets/applets/applets/applets/applets/applets/applets/applets/applets/applets/applets/applets/sounds/forms/linking/frames/document/linking/images/_AREA_onMouseOver.html" rel="nofollow noreferrer">http://www.htmlcodetutorial.com/quicklist.html/applets/applets/applets/applets/applets/applets/applets/applets/applets/applets/applets/applets/applets/applets/sounds/forms/linking/frames/document/linking/images/_AREA_onMouseOver.html</a> . Since I set my server to interpret .html as PHP the page is simply a copy of <a href="http://www.htmlcodetutorial.com/quicklist.html" rel="nofollow noreferrer">http://www.htmlcodetutorial.com/quicklist.html</a> . <strong>How do I stop Bingbot from looking for these bogus copies?</strong></p> <p><strong>Why is Bingbot looking for those pages to begin with?</strong></p> <p>I'd like to do something like the last line of the .htaccess file shown below (like at "<a href="https://stackoverflow.com/questions/2447106/redirect-to-apache-built-in-404-page-with-mod-rewrite">Redirect to Apache built-in 404 page with mod_rewrite?</a>"), but when I try <code>RewriteRule ^.*\.html\/.*$ - [R=404]</code> the entire site shows a 500 error.</p> <p>Even when I use the last line below it redirects to <a href="http://www.htmlcodetutorial.com/home/htmlcode/public_html/help.html" rel="nofollow noreferrer">http://www.htmlcodetutorial.com/home/htmlcode/public_html/help.html</a> which is not what I wanted.</p> <pre><code>AddType application/x-httpd-php .php .html RewriteEngine on Options +FollowSymlinks RewriteRule ^help\/.* help.html [L] RewriteCond %{HTTP_HOST} ^example.com RewriteRule (.*) http://www.htmlcodetutorial.com/$1 [R=301,L] ErrorDocument 404 /404.html RewriteRule ^.*\.html\/.*$ help.html [R=301] </code></pre> <p>P.S. I know the site is way out of date.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload