I have an index page with two urls:
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html')
And when I go to https://localhost/
it works fine, but https://localhost/index
is also valid. I want https://localhost/index
to always redirect to https://localhost/
without having to doing something like this:
@app.route('/')
def index():
return render_template('index.html')
@app.route('/index')
def index_redirect():
return redirect(url_for('index'))