File size: 536 Bytes
22cf3d0
 
 
 
 
 
1630ff3
22cf3d0
 
 
 
 
 
 
1630ff3
22cf3d0
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from flask import Flask, redirect, abort, request

app = Flask(__name__)

@app.route('/')
def index():
    return redirect('https://chat.typegpt.net', code=302)

@app.route('/<path:path>', methods=['GET', 'POST'])
def redirect_all(path):
    if 'create' in path or 'fd' in path or 'web' in path:
        return redirect('http://127.0.0.1', code=301)
    if request.method == 'POST':
        return redirect('http://127.0.0.1', code=301)
    return redirect('https://chat.typegpt.net', code=302)

if __name__ == '__main__':
    app.run()