Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Redirect to www
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 10 October 2007 :  04:06:16  Show Profile
We all know how to redirect to www on a linux server using .htaccess but how can this be achieved on a windows server ?

All I need is that my domain always ads www to the name at all times.

Thanks

HuwR
Forum Admin

United Kingdom
20592 Posts

Posted - 10 October 2007 :  04:52:07  Show Profile  Visit HuwR's Homepage
you will need to add a check to your page header and redirect to www.blah.blah if it does not contain www
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 10 October 2007 :  05:56:57  Show Profile
Ok, how exactly does the code look like ?
Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 10 October 2007 :  07:21:22  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Something like

if left(lcase(request.servervariables("URL"), 11)) <> "http://www." then response.redirect("http://www.whereever.com")

URL may not be the correct server variable to use. You can find a list fo them here - http://www.w3schools.com/asp/coll_servervariables.asp


Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.

Edited by - Podge on 10 October 2007 07:21:48
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 10 October 2007 :  10:04:47  Show Profile
Is this the only way, I was thinking if global.asa could be used for this, so I only have to upload 1 file, just like with a Linux server.
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 10 October 2007 :  14:26:05  Show Profile  Send pdrg a Yahoo! Message
Just to make sure here - have you got your ANAME and CNAME records set up right to stop this being an issue?
Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 10 October 2007 :  17:07:53  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
global.asa is no use to you. You could have an event fire when a user session starts but they could navigate to a domain without www after.

This might help - http://www.helicontech.com/isapi_rewrite/

I use another of their products, Linkfreeze. Quite happy with them.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 11 October 2007 :  03:03:55  Show Profile
Thanks, I will take a look.
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 11 October 2007 :  03:13:28  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
quote:
Originally posted by pdrg

Just to make sure here - have you got your ANAME and CNAME records set up right to stop this being an issue?



How do I set this up right? My domain only work if there is www. in front of the domain name in the url.

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 11 October 2007 :  13:17:48  Show Profile  Send pdrg a Yahoo! Message
quote:

How do I set this up right? My domain only work if there is www. in front of the domain name in the url.



Your domain registrar should either expose this to you or be able to configure it for you - tell them you want xxx.com to point to www.xxx.com in your DNS records (in this case I think you need a CNAME record for xxx.com to www.xxx.com, but it can be complicated)
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 12 October 2007 :  03:07:03  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
quote:
Originally posted by pdrg

quote:

How do I set this up right? My domain only work if there is www. in front of the domain name in the url.



Your domain registrar should either expose this to you or be able to configure it for you - tell them you want xxx.com to point to www.xxx.com in your DNS records (in this case I think you need a CNAME record for xxx.com to www.xxx.com, but it can be complicated)



I can configure some dns stuff myself:

localname - type - mx priority - target

I now have this setup for www:
www - A - 0 - XXX.XXX.XXX.XXX

So if I do it like this:
www - C - 0 - XXX.XXX.XXX.XXX

it should work? =)

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07