Solved

URL Rewriting and mobile URL rewriting

Posted on 2014-02-10
2
318 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can Angular be used with classic asp.net? 3 42
disadvantage of code behind appoarch in asp.net 3 48
How does this modal work? 3 33
Javascript function 3 20
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
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…

734 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