2014-03-30 76 views
0

在我的web應用程序,你獲得成功登錄後,通過header('Location: https://domain.com/loggedin')重定向但是當其完成重定向我到以下網址http://domain.com:443/loggedin這給(當然)以下錯誤PHP頭位置到https

400 Bad Request 

Your browser sent a request that this server could not understand. 
Reason: You're speaking plain HTTP to an SSL-enabled server port. 
Instead use the HTTPS scheme to access this URL, please. 

我有什麼改變?我做錯了什麼或者我需要添加什麼?

+1

http://stackoverflow.com/questions/8801340/php-header-location-redirect-https-to-https-http-to-http – Farkie

+0

看到這個http://security.stackexchange.com/q/46015/35190以及 –

+0

@Farkie我已經看過那個帖子了 – JSHelp

回答

1

這聽起來很荒謬,但經過一番思考: 我在最後加了一個斜槓(/),所以現在看起來像這樣header('Location: '.PROJECT_HTTP_ROOT.'/');

現在應該是這樣的!

+0

@nils不,你爲什麼想知道這個? – JSHelp