Change any request target to default page

If you want to redirect the user to default page instead route that he requested, you need to do the following

 

@BLUEPRINT_NAME.route('/DEFAULT_ROUTE', methods=['GET'])
def handler():
    return some staff

 

@BLUEPRINT_NAME.before_request
def check_cache_readiness():
    if not CLAUSE and request.path != '/DEFAULT_ROUTE':
         return redirect(url_for('.handler'))