How can I rewrite URLs in the Zeus web server for Mobile useragent?

匆匆过客 提交于 2019-12-06 01:44:04

Fixed it by changing

   set OUT:Location = /mobile.php

to

   set URL = /mobile.php

From the manual... Using Request Rewrite Scripts To use the request rewriting functionality, create a script in the Zeus Request Rewrite Scripting Language. The script contains instructions telling the Virtual Server how to change the URL or headers of requests that match specified criteria. The Virtual Server compiles the script, and (if the rewrite functionality is enabled) uses it every time it receives a request. It runs the commands in the script, changing the URL if it matches the specified criteria. Once the script is finished, the Virtual Server continues processing the resulting URL.Zeus Web Server 4.3 User Guide 142 Configuring URL Handling When changing the URL, the rewrite functionality can only change the local part of it, that is, the part of the URL after the host name. For example, if a user requests http://www.myhost.com/sales/uk.html, the rewrite functionality can only make changes to /sales/uk.html. This means that you cannot use the rewrite functionality to change the request to refer to a file on another Virtual Server. For example, the following script illustrates how to change requests for any HTML files in the /sales directory so that the user receives them from the /newsales directory instead: match URL into $ with ^/sales/(.).html if matched set URL=/newsales/$1.html The rewrite functionality can also change the HTTP headers that were received with a request, and create new HTTP headers to be returned to the user. For example, the following script changes the HTTP host header, so that a request for www.mysite.com/subserver is redirected to the Subserver www.subserver.mysite.com: match URL into $ with ^/([^/]+)/(.)$ if matched then set IN:Host = www.$1.mysite.com set URL = /$2 endif

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!