简体   繁体   English

将移动用户从单个网页页面重定向到压缩网页

[英]Redirecting mobile users away from individual webpages pages to condensed webpage

First off I'm designing a responsive website, based around 3 sizes taking into account mobile, tablet and desktop. 首先,我要设计一个响应式网站,该网站基于3种大小,并考虑到了手机,平板电脑和台式机。 The tablet and desktop are almost identical as I've set the tablet design to shrink down slightly from the desktop version. 平板电脑和台式机几乎完全相同,因为我将平板电脑的设计比台式机版本略微缩小。

The website will be using a fluid grid system to allow for the responsive design, while also using PHP includes for header, footer and sidebar. 该网站将使用流体网格系统进行响应式设计,同时还将使用PHP包括页眉,页脚和侧边栏。

The problem is, I want to minimalize content and information for mobile devices, to do this I want to stop the user being able to access the individual service pages and re-direct them to a different page that condenses all of the information from the indervidual webpages into one webpage. 问题是,我想最小化移动设备的内容和信息,为此,我想阻止用户访问单独的服务页面,并将其重定向到另一个页面,该页面凝聚了来自个人的所有信息。网页合并为一个网页。

My Question is how would I approach this? 我的问题是我将如何处理? for some reason I seem to think it can be done by .htaccess, although I'm not sure how, has anyone else run into this sort of thing before? 由于某种原因,我似乎认为它可以通过.htaccess完成,尽管我不确定如何,以前是否有人遇到过这种情况? are there any other methods to deal with this? 还有其他方法可以解决吗?

.htaccess should be able to do the trick have a look at: https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond . .htaccess应该能够解决问题,请查看: https : //httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond It would require checking the browser agent unless you have a mobile specific url setup. 除非您具有移动设备专用的URL设置,否则将需要检查浏览器代理。 It would be done something like this. 会做这样的事情。

...
RewriteCond %{HTTP_USER_AGENT} *user agent to redirect*
RewriteCond %{URL} *url to redirect from*
RewriteRule specificpage general page
...

Both the user agent and url are considered regexp. 用户代理和URL均被视为正则表达式。 I don't know any other way besides javascript on the page. 除了页面上的javascript外,我不知道其他任何方式。 Also the answer to this question may be helpful. 这个问题的答案也可能会有所帮助。

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

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