Gihan
Gihan

Reputation: 3749

How to Show a 503 Error for a Single Page

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.

Upvotes: 2

Views: 229

Answers (1)

RavinderSingh13
RavinderSingh13

Reputation: 133508

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]

Upvotes: 3

Related Questions