Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hey guys, I am going to need to create a rewrite right off of the root of a site. I have a field in a database and I need to do a rewrite like this:
http://www.mysite.com/some-dealer-name
Which would then redirect to "/view.aspx?dealer=some-dealer-name"
Is that even possible to redirect like that right off the site root?
Robert
It should be possible. I'm thinking something ike this would work:
<add name="YourRewriteRule" virtualUrl="^~/([0-9a-z-]+)(.aspx)?$" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/view.aspx?dealer=$1" ignoreCase="true" regexOptions="RightToLeft" />
Edit: Now that I test it out, everything at the top level will get redirected unless there is some path or prefix to test for.
That would be fine I guess... except I have some subpages configured to use different hostnames. How do hostnames play into URL rewrites?
That doesn't work for me in any case... any other suggestions? This is a tricky one, URL rewrites always confuse me!
Oh wait, it does work!!! Awesome, thanks so much my friend! :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
URL Rewrite: Is This Possible?
Hey guys, I am going to need to create a rewrite right off of the root of a site. I have a field in a database and I need to do a rewrite like this:
http://www.mysite.com/some-dealer-name
Which would then redirect to "/view.aspx?dealer=some-dealer-name"
Is that even possible to redirect like that right off the site root?
Robert
It should be possible. I'm thinking something ike this would work:
Edit: Now that I test it out, everything at the top level will get redirected unless there is some path or prefix to test for.
That would be fine I guess... except I have some subpages configured to use different hostnames. How do hostnames play into URL rewrites?
That doesn't work for me in any case... any other suggestions? This is a tricky one, URL rewrites always confuse me!
Oh wait, it does work!!! Awesome, thanks so much my friend! :-)
is working on a reply...