swaggerking
asked on
Redirect user to corresponding mobile page based on incoming url
I'm currently running a javascript on my site that redirects some mobile users with specific screen width to my mobile site.
I would ideally like to push certain incoming urls (some with parameters) to the corresponding page on the mobile site.
Example:
Incoming url might be:
mysite.com/details.asp?ref =123&prod= foo
I would like to redirect them to:
mysite.com/m/details/?ref= 123&prod=f oo
or
mysite.com/videos to mysite.com/m/videos
<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "mysite.com/m/";
}
-->
</script>
I would ideally like to push certain incoming urls (some with parameters) to the corresponding page on the mobile site.
Example:
Incoming url might be:
mysite.com/details.asp?ref
I would like to redirect them to:
mysite.com/m/details/?ref=
or
mysite.com/videos to mysite.com/m/videos
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks. That is exactly what I was looking for.
for IIS7 - http://www.iis.net/downloads/microsoft/url-rewrite
IIS6 and below - www.isapirewrite.com (free to use)
then you just create a reg exp to determine how the url is redirected