How To Show A 503 Error For a Single Page

Viewed 76

I want to show a 503 error for a page on my website. (Using htacess) So far I've tried the following but it seems to be not working.

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /league.php [R=503,L]

Is this correct? Or is there anyway to give the absolute URL path? Thanks.

1 Answers

Could you please try following, tested and written with shown samples. Please make sure you clear your browser cache before testing your URLs.

RewriteEngine ON
RewriteCond %{REQUEST_URI} ^/webmail/?$ [NC]
RewriteRule ^(.*)$ league.php [R=503,L]

OR using errordocument option.

ErrorDocument 503 /league.php
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/webmail/?$ [NC]
RewriteRule .* - [R=503,L]
Related