简体   繁体   English

重定向到安全移动站点

[英]Redirecting to Secure Mobile Site

I have this .NET website, with an SSL. 我有一个带有SSL的.NET网站。 But when I try to see the Blackberry version of this site, the following message appears on my blackberry screen. 但是,当我尝试查看此站点的Blackberry版本时,以下消息出现在我的Blackberry屏幕上。

"HTTP ERROR 403 FORBIDDEN" "You're not authorized to view this page. Please try loading a different page". “ HTTP错误403禁止”“您无权查看此页面。请尝试加载其他页面。” It gives you two options then: "OK" and "DETAILS" Once I click on "Details" it brings me to the mobile version of the site correctly. 然后,它将为您提供两个选项:“确定”和“详细信息”单击“详细信息”后,它将带我正确进入网站的移动版本。

Is there anything I could do to avoid having this problem on the Blackberry Site ? 我有什么办法可以避免在Blackberry网站上出现此问题? I just want to write on blackberry browser: http://nameofthesite.com and it should take me to the mobile version with secure connection...without sending that error. 我只想在黑莓浏览器上写: http : //nameofthesite.com ,它应该带我到具有安全连接的移动版本...而不发送该错误。

And my redirectssl.html file (the one that redirects the non-mobile version) is written with the following source: 我的redirectssl.html文件(用于重定向非移动版本的文件)是使用以下源代码编写的:

<HTML>
<TITLE>Redirect to Secure Site</TITLE>
<script language=javascript>
     self.location = "https://www.nameofthesite.com"
</script>
<noscript>
<META HTTP-EQUIV=Refresh CONTENT="1; URL=https://www.nameofthesite.com">
</noscript>
<B>This site requires SSL. Redirecting...</B>
<BR>
<BR>
If you are not redirected immediately, please click <A href="https://www.nameofthesite.com">here</A>
</HTML>

This should be done on the server side using proper HTTP redirect status codes . 应该在服务器端使用正确的HTTP重定向状态代码完成

Firstly most older phones simply wont deal with the javascript. 首先,大多数较老的手机根本不会处理javascript。 Secondly this is just plan bad practice to make a browser download an HTML page to deal with HTTP redirects it is ugly and makes for very hard to maintain and understand code later on. 其次,这是一种计划不好的做法,它会让浏览器下载HTML页面来处理HTTP重定向,这很丑陋,以后很难维护和理解代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM