Results 1 to 3 of 3

Thread: html files redirecting to error page

  1. #1
    New user
    Join Date
    08-08-11.
    Posts
    10

    Default html files redirecting to error page

    We just upgraded to Contao 2.11.2. We have a folder containing html emails on the server. Whenever I try to open the html files in a web browser I'm getting a 404 error. I can change the file extension to .php instead of .html and then see them. I know it has something to do with the .htaccess file. When I pull it down temporarily I was able to view the .html files again in my browser. Does anyone know how I can fix this issue so that html files on the server are viewable?

  2. #2
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: html files redirecting to error page

    There's a line in the .htaccess file with a bunch of pipe-separated file extensions:
    https://github.com/contao/core/blob/mas ... fault#L151

    Add "html" to that list, and I think that will do it.

    P.S. If "HTML" is also your URL suffix, then that won't work. You'd need an additional rule to not rewrite .html files in a specific folder (where those emails are being stored).

    I forget exactly how to do this, but it's something like "RewriteCond %{REQUEST_URI} !/someFolderName/.*" And it goes right before the rewrite rule.
    Brian

  3. #3
    New user
    Join Date
    08-08-11.
    Posts
    10

    Default Re: html files redirecting to error page

    Thanks for the reply. I may just rename the files to .htm for now. It's strange though, we're running the same Contao versions on two other servers and not getting the issue with those severs.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •