Solved

URL Rewriting and mobile URL rewriting

Posted on 2014-02-10
2
302 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:
servoadmin 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

707 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

17 Experts available now in Live!

Get 1:1 Help Now