Rank: Member
Joined: 6/1/2004(UTC) Posts: 720
|
I have a site that functions on a subdomain. If the customer inserts www before the subdomain the WildCard SSL Cert will not recognize the SSL. Is there a way the I can configure something so that anyone who types: http://www.usa.yourticketzone.com is re-directed to http://usa.yourticketzone.com? (no "www") Thanks, d. |
|
|
|
|
Rank: Member
Joined: 11/25/2003(UTC) Posts: 370
|
Look this over. In C# but can do in VB.Net. Just switch it around from presented form. http://www.mycsharpcorner.com/Post.aspx?postID=40 |
|
|
|
|
Rank: Member
Joined: 6/1/2004(UTC) Posts: 720
|
Thanks Kim,
Would this go in the global.asax file?
Thanks, d |
|
|
|
|
Rank: Member
Joined: 9/26/2008(UTC) Posts: 121
|
Hi Derek, I think adding redirect directive to page load event of App_Code/BaseStorePage.vb will do the job. So the code will look like: Code: if request.Url.AbsoluteUri="http://www.usa.yourticketzone.com" then response.redirect("http://usa.yourticketzone.com") end if
Hope this helps. |
|
|
|
|
Rank: Member
Joined: 6/1/2004(UTC) Posts: 720
|
thanks...I will give that a shot! |
|
|
|
|
Rank: Member
Joined: 6/1/2004(UTC) Posts: 720
|
sorry, where exactly within the basestorepage.vb file would it go?
Thanks for your help! Derek |
|
|
|
|
Rank: Member
Joined: 9/26/2008(UTC) Posts: 121
|
Try to place it beneath the: [2]
Code: Protected Sub BasePage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[/2][2] [/2] |
|
|
|
|
Rank: Member
Joined: 9/26/2008(UTC) Posts: 121
|
Also to avoid Caps locks typing problem like http://www.Usa.yourticketzone.com it's better to add such code instead of one I provided: Code: if request.Url.AbsoluteUri.ToLower()="http://www.usa.yourticketzone.com" then response.redirect("http://usa.yourticketzone.com") end if
|
|
|
|
|
Rank: Member
Joined: 6/1/2004(UTC) Posts: 720
|
|
|
|
|
|
Rank: Member
Joined: 6/1/2004(UTC) Posts: 720
|
Hi Customizer,
I tried both versions inserted directly below the :
Protected Sub BasePage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
and neither seemed to work. I will continue testing.
Thanks, Derek |
|
|
|
|
Rank: Member
Joined: 9/26/2008(UTC) Posts: 121
|
Oh, think I found the problem. Webserver puts the page name after domain name even if it was not specified so this should work: Code: if request.Url.AbsoluteUri.ToLower().Contains("[url=http://www.usa.yourticketzone.com]http://www.usa.yourticketzone.com[/url]") then response.redirect(request.Url.AbsoluteUri.Replace("http://www.usa.yourticketzone.com","http://usa.yourticketzone.com") ) end if
|
|
|
|
|
Rank: Member
Joined: 6/1/2004(UTC) Posts: 720
|
Excellent!!! Thanks Customizer...that did the trick : )
Have a great Christmas!
Derek |
|
|
|
|
Rank: Member
Joined: 9/26/2008(UTC) Posts: 121
|
You are welcome.
Have a nice Christmas. |
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.