使用 51° 重定向到移动子域
我正在使用 51 Degrees API 进行移动重定向: http://51 Degrees.codeplex.com/
- 桌面站点位于 http://www.mydomain.com。
- 移动网站位于 http://m.mydomain.com。
当使用 51°s 检测到移动设备时,我可以仅使用 51°s 配置从任何桌面页面重定向到移动主页。即 http://www.mydomain.com/somepage 到 http://m.somepage.com/default。
我无法做的是重定向到同一页面,即从 http://www.mydomain.com/somepage< /a> 到 http://m.somepage.com/somepaage。
是否可以重定向到同一页面?
I'm using the 51degrees API for mobile redirection: http://51degrees.codeplex.com/
- The desktop site is located at http://www.mydomain.com.
- The mobile site is located at http://m.mydomain.com.
When a mobile device is detected, using 51degrees, I am able to redirect from from any desktop page to the mobile homepage using the 51degrees configuration only. I.e. http://www.mydomain.com/somepage to http://m.somepage.com/default.
What I am unable to do is redirect to the same page, i.e. from http://www.mydomain.com/somepage to http://m.somepage.com/somepaage.
Is it possible to redirect to the same page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
选项 1:仅对移动检测部分使用 51 度,并自行连接重定向。从 web.config 中删除
元素,并在 Global.asax 文件中尝试类似的操作:选项 2:在
中在 web.config 文件中的
元素中,添加属性originalUrlAsQueryString=true
。这会将名为 origUrl 的查询字符串发送到移动主页,让您可以选择重定向到所请求页面的移动版本。Option 1: Use 51degrees for the mobile detection part only and wire up the redirect yourself. Remove the
<redirect>
element from your web.config and try something like this in your Global.asax file:Option 2: In the
<redirect>
element in the web.config file, add the propertyoriginalUrlAsQueryString=true
. This will send a query string called origUrl to the mobile homepage giving you the option to redirect to the mobile version of the requested page.您可以在 51Degrees.mobi 用户指南。
You can find information about how to configure it to redirect to mobile versions of a page in section 2.1.2 in 51Degrees.mobi User Guide.