2014-11-21 110 views
2

是否有可能像Web應用程序中基於TWebModule的瀏覽器地址輸入字段中顯示的完整路徑?我想要做的是,如果用戶從管理Web前端更改服務的端口,則自動重定向用戶。例如:在Delphi中獲取完整的URL TWebmodule

https://someserver:3333/changesettings 

是當前網址。 Request.pathinfo只給我「更改設置」。但我需要更多的重定向到

https://someserver:1234/changesettings 

任何幫助,非常感激。提前致謝!

回答

4

對不起,在問這個問題之後,我馬上就發現了需要的信息,它是Request.host。我現在可以輕鬆地創建重定向:

redirecturl:='https://'+request.Host+':'+intToStr(port)+'/settings'; 

我喂的是回到一個標籤在pageproducer用下面的代碼

<html> 
<head> 
<meta http-equiv="Refresh" content="0; url=<#redirecturl>" /> 
</head> 
<body> 

作品!