patternphpMajor
Using 503 page when my site is in maintenance mode
Viewed 0 times
modemaintenance503siteusingwhenpage
Problem
This is my code for 503 page:
header.php
503.php
I want to know if my code is correct and how Google will handle SEO thing. I don't have much knowledge about this, so it would be very helpful if someone could validate this code.
header.php
if(getOption('maintence_mode')==1)
{
header("location:503.php");
exit;
}503.php
Page Not Found
Site is currently in maintenance mode.
I want to know if my code is correct and how Google will handle SEO thing. I don't have much knowledge about this, so it would be very helpful if someone could validate this code.
Solution
It looks good to me, but I do have one thing to say.
If I want to access
What you do is redirect the user to the 503 page, which means that the address I'll get now if I refresh is
Instead of redirecting, include the 503 error page.
Also some other things:
If I want to access
http://yourdomain.com/example/page, and get a 503 error, I want to be able to refresh the page in a little while, to see if the 503 error is lifted.What you do is redirect the user to the 503 page, which means that the address I'll get now if I refresh is
http://yourdomain.com/503.php, this is not optimal.Instead of redirecting, include the 503 error page.
Also some other things:
- The error says 503, but your titles says "Page not Found"
- Code indentation is important. Don't neglect it!
- Never use an
ifblock without curly brackets. Never.
Context
StackExchange Code Review Q#60467, answer score: 38
Revisions (0)
No revisions yet.