Forum

Thread tagged as: Question, Problem, Configuration

505 error instead of 404

Hey

I'm not that familiar with all the errors as such but I'm wondering why i'm getting a horrible 505 error pager instead of a 404?

My 404 does work but only on certain pages.So:

https://kieranhunter.co.uk/error - Works (404)

https://kieranhunter.co.uk/about/error - Doesn't work (500)

Sorry for the massive pasting on htaccess file.

<IfModule mod_rewrite.c>

    RewriteEngine On

    ErrorDocument 400 /404.php
    ErrorDocument 401 /404.php
    ErrorDocument 403 /404.php
    ErrorDocument 404 /404.php
    ErrorDocument 500 /404.php
    ErrorDocument 502 /404.php
    ErrorDocument 504 /404.php

    RewriteRule ^detail/([a-zA-Z0-9-]+)$ /detail.php?s=$1 [L]

    RewriteRule ^category/([a-zA-Z0-9-/]+)$ /category.php?cat=$1 [L]

    RewriteRule ^blog/([a-zA-Z0-9-]+)$ /blog/post.php?s=$1 [L]

    RewriteRule ^blog/([a-zA-Z0-9-]+)/preview$ /blog/post.php?s=$1&preview=all [L]

    RewriteRule ^blog/category/([a-zA-Z0-9-]+)/page/([0-9]+)/{0,1}$ /blog/archive.php?cat=$1&page=$2 [L]
    RewriteRule ^blog/category/([a-zA-Z0-9-]+)$ /blog/archive.php?cat=$1 [L]

    RewriteRule ^blog/date/([a-zA-Z0-9-]+)/page/([0-9]+)/{0,1}$ /blog/archive.php?year=$1&page=$2 [L]
    RewriteRule ^blog/date/([a-zA-Z0-9-]+)$ /blog/archive.php?year=$1 [L]

    RewriteRule ^blog/date/([a-zA-Z0-9-]+)/([a-zA-Z0-9-/]+)/page/([0-9]+)/{0,1}$ /blog/archive.php?year=$1&month=$2&page=$3 [L]
    RewriteRule ^blog/date/([a-zA-Z0-9-]+)/([a-zA-Z0-9-/]+)$ /blog/archive.php?year=$1&month=$2 [L]

    RewriteRule ^blog/tag/([a-zA-Z0-9-]+)/page/([0-9]+)/{0,1}$ /blog/archive.php?tag=$1&page=$2 [L]
    RewriteRule ^blog/tag/([a-zA-Z0-9-]+)$ /blog/archive.php?tag=$1 [L]

    RewriteRule ^blog/([a-zA-Z0-9-]+)/([a-zA-Z0-9-/]+)/page/([0-9]+)/{0,1}$ /blog/archive.php?year=$1&month=$2&page=$3 [L]
    RewriteRule ^blog/([a-zA-Z0-9-]+)/([a-zA-Z0-9-/]+)$ /blog/archive.php?year=$1&month=$2 [L]

    RewriteRule (.*).xml(.*) $1.php$2 [nocase]

    # Redirect to PHP if it exists.
    # e.g. example.com/foo will display the contents of example.com/foo.php

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f 
    RewriteRule ^(.+)$ $1.php [L,QSA]

    #re-direct all /portfolio pages to /detail

    RedirectMatch ^/portfolio/(.*)$ /detail/$1

</IfModule>

Thanks a lot

Kieran Hunter

Kieran Hunter 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

If you are getting a 505 error then your host would be the place to raise a ticket to find out why you are getting that error.

"505 HTTP Version Not Supported The server does not support the HTTP protocol version used in the request."

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Right ok, so it's nothing to do with Perch.

Thanks a lot :)