Announcement

Collapse
No announcement yet.

410 error with htaccess for all *.html pages in Joomla?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 410 error with htaccess for all *.html pages in Joomla?

    Recently, I had a problem with my web server. Having a security hole at Joomla, somebody created thousands of files (ending in *.html) in my website.

    I have removed all these files, but Google keep querying this particular files. I have previously added a more than hundred of pages at Google Webmaster Tools being removed, however there are still lots of files.

    I just want to put a rule in the .htaccess file to return a 410 error code when any file ending with .html is requested, EXCEPT if the page is googlea1b2c3d4e5f6.html (a file from google).

    How to sort out this problem?

  • #2
    You can add the following rule in htaccess:

    RewriteEngine on

    #--exclude "/googlea1b2c3d4e5f6.html--#
    RewriteCond %{REQUEST_URI} !^/googlea1b2c3d4e5f6\.html$ [NC]
    #--redirect all .html requests to 410 Gone--#
    RewriteRule \.html$ - [R=410,L]

    Comment


    • #3
      This is the kind of thing CMSs(/etc) should handle automatically. I don't want to have to tell anything that I've deleted a file; it should know. Perhaps this would require more integration between the HTTP server and the file storage system than is currently 9Apps Showbox usual.
      Last edited by winkibili; 13-05-21, 06:03 PM.

      Comment

      Working...
      X