Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other htaccess 404 page for specific subdirectory only

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #252562
    Alexand
    Participant

    I am having a hard time adding a 404 not found page to a specific sub directory example.com/staging/ where I have a small website running which is completely independant from the website in root. However, I constantly get 500 Internal Server Errors.

    The website in the sub directory consists of static html pages only, no CMS or databases are attached to it. The 404.html is placed directly in the root of the sub directory /staging/.

    The code which is in my .htaccess file for the directory example.com/staging/:
    “`
    Options -Indexes -MultiViews
    RewriteEngine on
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule ^(.*)$ $1.html [L]
    RewriteRule ^arbeiten/$ /staging/arbeiten/alle [R=301,L]
    RewriteRule ^journal/$ /staging/journal/journal-alle [R=301,L]
    ErrorDocument 404 /staging/404.html
    “`

Viewing 1 post (of 1 total)
  • The forum ‘Other’ is closed to new topics and replies.