Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

URL Rewriting and mobile URL rewriting

Posted on 2014-02-10
2
Medium Priority
?
335 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 1500 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Suggested Courses

971 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