When I start a http server using a command:
python -m SimpleHTTPServer
How can i change the default 404 page?
With command line, it is impossible.
You should make a script like following:
import BaseHTTPServer
import SimpleHTTPServer
class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
error_message_format = '''
custom error message
'''
BaseHTTPServer.test(MyHandler, BaseHTTPServer.HTTPServer)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With