Redirecting to Full Domain

I currently have a ASP .Net web application. I have some cross domain referencing in my application, so when users visit my page, I need to ensure they enter the full domain name.

So for example I need to redirect from

http://someserver/someapplication.page.aspx

to

http://someserver.domain.com/someapplication.page.aspx

I have the REGEx set up to catch the URL if it does not have the domain.com, also to hold anything after the ‘someserver/’, lets call this ‘RegExMatch’. I just need to know what to call within to get the Full domain –

Response.Redirect({0}+RegexMatch);

Thanks in advanced.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Found a way to do this in the IIS settings of the Application.

For anyone that is interested, here are the details. It is called Url Rewrite.
http://www.iis.net/learn/extensions/url-rewrite-module/seo-rule-templates.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x