Solved

Append http://www to a URL

Posted on 2016-08-03
4
51 Views
Last Modified: 2016-08-04
I would like to append http://www. either through code or in IIS. What is the best way of going about this ?

Thanks,
Aditya
0
Comment
Question by:giveindia
4 Comments
 
LVL 33

Expert Comment

by:paulmacd
Comment Utility
I'm guessing you mean prepend, not append; and the answer depends a lot on what it is you're trying to do.  The most basic answer would be something like...

Dim strNewURL as String = ""
strNewURL = "http://www." & strOldURL

...but it's hard to say without more information.
0
 
LVL 35

Expert Comment

by:YZlat
Comment Utility
Try checking whether the string starts with "http://www." first:

If Not strURL.StartsWith("http://www.", StringComparison.InvariantCulture) Then
	strURL = "http://www." & strURL

End if

Open in new window

0
 
LVL 26

Accepted Solution

by:
Dan McFadden earned 500 total points
Comment Utility
I recommend using IIS URL Rewrite model.

Here's an article to explain how to do it.

Link:  http://weblogs.asp.net/owscott/iis-url-rewrite-rewriting-non-www-to-www

Dan
0
 

Author Closing Comment

by:giveindia
Comment Utility
That worked.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

13 Experts available now in Live!

Get 1:1 Help Now