Solved

URL Rewriting and mobile URL rewriting

Posted on 2014-02-10
2
312 Views
Last Modified: 2014-07-15
I have a site (.net) and want to configure URL rewriting, so that for desktop:

http://domain.com/category/content/23

rewrites to

/content.aspx?pageid=23

and for mobile it simply appends the subdomain: http://m.domain.com/category/content/23

All my mobile files are under a directory "mobile".

I have manged to sort out the desktop url rewriting, but can't get mobile one working. For desktop I have the following rule:

    <rule name="rewrite_rule">
              <match url="(\d*)/content/(\d*)" />
              <conditions>
                <add input="{HTTP_HOST}" pattern="domain\.com" />
              </conditions>
              <action type="Rewrite" url="content.aspx?pageid={R:2}" appendQueryString="true" />
    </rule>

and for mobile I have:

 

    <rule name="rewrite_rule2">
              <match url="/content/(\d*)" />
              <conditions>
                <add input="{HTTP_HOST}" pattern="^m\.domain\.com" />
              </conditions>
              <action type="Rewrite" url="/mobile/content.aspx?pageid={R:1}" appendQueryString="true" />
     </rule>

but if I type in URL with mobile subdomain, it takes me to the desktop version, i.e. my desktop rule is fired instead of mobile one.

please help.

thanks
0
Comment
Question by:pritamw
2 Comments
 
LVL 13

Accepted Solution

by:
Praveen DM earned 500 total points
ID: 39847403
Try creating the subdomain separately and try 302 redirect with URL rewrite rule for mobile.
0
 

Author Comment

by:pritamw
ID: 39847438
Sorry, i dont follow. "subdomain separately" as in a separate website? thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question