如何将URL重定向到移动版本? [英] How to redirect URL to mobile version?

查看:121
本文介绍了如何将URL重定向到移动版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户代理是移动版,我想将某些URL重定向到移动版.

I want to redirect some URL to mobile version, if the user agent is a mobile.

示例:

klikkarir.com/jawa-pos/5215/lowongan-call-center-accounting-administration-pt-asia-teleservices-januari-2010.html

klikkarir.com/jawa-pos/5215/lowongan-call-center-accounting-administration-pt-asia-teleservices-januari-2010.html

将重定向到:

m.klikkarir.com/5215/lowongan-call-center-accounting-administration-pt-asia-teleservices-januari-2010/

m.klikkarir.com/5215/lowongan-call-center-accounting-administration-pt-asia-teleservices-januari-2010/

有人帮助我.

推荐答案

我使用 http://detectmobilebrowser.com ,并发现这是最快,最简单的方法.效果很好.该站点自动生成服务器脚本(php,perl,python,coldfusion,apache,jquery等),该脚本检测移动浏览器并进行相应的重定向.您只需将代码复制并粘贴到索引文件中的某个位置即可.

I use http://detectmobilebrowser.com, and found it is the quickest and easiest way. It works quite well. This site generates server scripts automatically (php, perl, python, coldfusion, apache, jquery, etc.) that detects mobile browser and redirects accordingly. You can just copy and paste the code somewhere in your Index file.

这篇关于如何将URL重定向到移动版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆