私はPython Webサーバーを作成しており、URLの見栄えを良くしたい部分にいます。私www.example.com/index.html
はwww.example.com
.
私の Web サイトには という別のページがありauth.html
、ログイン ページとして機能します。www.example.com
からに移動するときはいつでもうまく機能しwww.example.com/auth
ますが、リンクをクリックして戻ると、インデックス ページにあるにもかかわらず、ブラウザにwww.example.com
表示されます。www.example.com/auth
これは大したことではないかもしれないとあなたは言いwww.youtube.com
ます。これは、ユーザーにとって非常に混乱を招きます。www.youtube.com/profile/user1231251
www.youtube.com
www.youtube.com/profile/user1231251
私の現在のリクエストハンドラーには、次のような数行のコードがあります。
if self.path.endswith(""):
#Make html file, send response and write html file in wfile
if self.path.endswith("auth"):
#Make auth page, return to browser, etc
TLDR:www.example.com/auth
ページから私のホームページ ( ) に戻ると、リンクwww.example.com
が表示されます。www.example.com/auth