Solved

URL Rewriting and mobile URL rewriting

Posted on 2014-02-10
2
305 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error viewing ASP page 12 148
DNN auto-updating it's core ? 2 36
Syntax Error 2 44
Migrate Application To New Mac 5 31
Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This video teaches users how to migrate an existing Wordpress website to a new domain.
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now