3 ms·
How to Return 503 Service Unavailable or other specific HTTP Status Code
- deleted 15y ago[deleted]
- adamrmcd 15y agoThe Apache example is incomplete. For me, I used Chrome to "download the strike page" from http://sopastrike.com/strike/ http://sopastrike.com/strike/ and saved it on my server as /strike.html. Then, I added the following to my .htaccess: RewriteEngine on RewriteCond %{REQUEST_URI} !strike.html RewriteCond %{REQUEST_URI} !^/strike_files/ RewriteRule (.*) /strike.html [R=503,L] ErrorDocument 503 /strike.html This will trigger 503 for every page request but /strike.html and its subdirectory, also Apache will serve the strike page content for browsers in place of any status codes 200 or 302 on the original request url.
- sathishmanohar 15y agoGreat! Shall I add this to the Post?