|
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
IIS Question
Is there a way with IIS to automatically redirect traffic from mydomain.comChe Vilnonis 05/05/08 09:58 A In your Application.cfc/.cfm, you can check the CGI variables and thenDawson, Michael 05/05/08 10:40 A Mike, I never thought of that.Che Vilnonis 05/05/08 10:50 A onRequestStart appears to be the best place for this code.Dawson, Michael 05/05/08 11:48 A Put this at the top of your application.cfm (test this first since I justJacob 05/05/08 12:01 P Jacob... that is exactly what I am looking for. And yes, I am doing this forChe Vilnonis 05/05/08 12:07 P Also...Jacob 05/05/08 12:40 P Thanks for the tip. I almost forgot to do that! :)Che Vilnonis 05/05/08 12:52 P I think that is more of a dns issue than an IIS one. You should have a DNSEric Roberts 05/05/08 11:42 A Try Ionics IIRF; free and open source rewrite.David 05/05/08 04:03 P I tend to create 2 sites in IIS, one containing the host-headerJediHomer 05/06/08 07:34 A Why do you do that? Preserving the original domain?Cutter (CFRelated) 05/08/08 10:55 A Just so that all domains and variations for that domain are sent toJediHomer 05/08/08 12:12 P If you're doing your own dns, why not just add another host header forKevin Aebig 05/05/08 11:29 A Is there a way with IIS to automatically redirect traffic from mydomain.com to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? Thanks, Che In your Application.cfc/.cfm, you can check the CGI variables and then redirect the browser. m!ke Is there a way with IIS to automatically redirect traffic from mydomain.com to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? Thanks, Che Mike, I never thought of that. Should the code be placed in the onRequestStart function? Also, this would be a case where I'd need a 301 redirect, right? Thanks, Che In your Application.cfc/.cfm, you can check the CGI variables and then redirect the browser. m!ke Is there a way with IIS to automatically redirect traffic from mydomain.com to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? onRequestStart appears to be the best place for this code. 301 would be appropriate if that is what you want. Will this be a permanent or temporary redirect? Also, the additional DNS entry suggestions may be a better solution, if that is an option for you. m!ke Mike, I never thought of that. Should the code be placed in the onRequestStart function? Also, this would be a case where I'd need a 301 redirect, right? Thanks, Che Put this at the top of your application.cfm (test this first since I just typed it). <cfif cgi.server_name does not contain "www.domain.com"> <cfheader statuscode="301" statustext="Moved Permanently"> <cfheader name="location" value="http://www.domain.com#trim(script_name)#"> <cfabort> </cfif> I use this to help with canonical issues and search engines. Mike, I never thought of that. Should the code be placed in the onRequestStart function? Also, this would be a case where I'd need a 301 redirect, right? Thanks, Che In your Application.cfc/.cfm, you can check the CGI variables and then redirect the browser. m!ke Is there a way with IIS to automatically redirect traffic from mydomain.com to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? Jacob... that is exactly what I am looking for. And yes, I am doing this for search engines ranking purposes. Otherwise, it would not matter to me. ;) Eric, I'm no DNS wiz, but I already have a "www" and a "blank" host A-record entry entry for the domain that points to the same IP. I simply wanted all domain.com traffic to go to www.domain.com automatically. Put this at the top of your application.cfm (test this first since I just typed it). <cfif cgi.server_name does not contain "www.domain.com"> <cfheader statuscode="301" statustext="Moved Permanently"> <cfheader name="location" value="http://www.domain.com#trim(script_name)#"> <cfabort> </cfif> I use this to help with canonical issues and search engines. Mike, I never thought of that. Should the code be placed in the onRequestStart function? Also, this would be a case where I'd need a 301 redirect, right? Thanks, Che In your Application.cfc/.cfm, you can check the CGI variables and then redirect the browser. m!ke Is there a way with IIS to automatically redirect traffic from mydomain.com to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? Also... For Google, set up the Google Webmaster tools for your website. Add your site and set the preferred domain to "www". https://www.google.com/webmasters/tools/siteoverview?hl=en Jacob Jacob... that is exactly what I am looking for. And yes, I am doing this for search engines ranking purposes. Otherwise, it would not matter to me. ;) Eric, I'm no DNS wiz, but I already have a "www" and a "blank" host A-record entry entry for the domain that points to the same IP. I simply wanted all domain.com traffic to go to www.domain.com automatically. Put this at the top of your application.cfm (test this first since I just typed it). <cfif cgi.server_name does not contain "www.domain.com"> <cfheader statuscode="301" statustext="Moved Permanently"> <cfheader name="location" value="http://www.domain.com#trim(script_name)#"> <cfabort> </cfif> I use this to help with canonical issues and search engines. Mike, I never thought of that. Should the code be placed in the onRequestStart function? Also, this would be a case where I'd need a 301 redirect, right? Thanks, Che In your Application.cfc/.cfm, you can check the CGI variables and then redirect the browser. m!ke Is there a way with IIS to automatically redirect traffic from mydomain.com to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? Thanks for the tip. I almost forgot to do that! :) Also... For Google, set up the Google Webmaster tools for your website. Add your site and set the preferred domain to "www". https://www.google.com/webmasters/tools/siteoverview?hl=en Jacob Jacob... that is exactly what I am looking for. And yes, I am doing this for search engines ranking purposes. Otherwise, it would not matter to me. ;) Eric, I'm no DNS wiz, but I already have a "www" and a "blank" host A-record entry entry for the domain that points to the same IP. I simply wanted all domain.com traffic to go to www.domain.com automatically. Put this at the top of your application.cfm (test this first since I just typed it). <cfif cgi.server_name does not contain "www.domain.com"> <cfheader statuscode="301" statustext="Moved Permanently"> <cfheader name="location" value="http://www.domain.com#trim(script_name)#"> <cfabort> </cfif> I use this to help with canonical issues and search engines. Mike, I never thought of that. Should the code be placed in the onRequestStart function? Also, this would be a case where I'd need a 301 redirect, right? Thanks, Che In your Application.cfc/.cfm, you can check the CGI variables and then redirect the browser. m!ke Is there a way with IIS to automatically redirect traffic from mydomain.com to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? I think that is more of a dns issue than an IIS one. You should have a DNS entry that says (I forget the exact verbage) to the effect of www and have that point to @ (which should be assigned to mydomain.com or something to that effect. This is how I have mine set up... (CNAME)www @ (CNAME)ftp @ @ points to the ip of my server(via the A Record)... (courtesy of the godaddy dns manager ;-) ) Eric /*-----Original Message----- /* /*Sent: Monday, May 05, 2008 9:00 AM /*To: CF-Talk /*Subject: OT: IIS Question... /* /*Is there a way with IIS to automatically redirect traffic from /*mydomain.com /*to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? /* /*Thanks, Che /* /* /* Try Ionics IIRF; free and open source rewrite. http://cheeso.members.winisp.net/IIRF.aspx http://www.codeplex.com/IIRF On Mon, May 5, 2008 at 9:59 AM, Che Vilnonis <chevy@asitv.com> wrote: > Is there a way with IIS to automatically redirect traffic from mydomain.com > to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? > > Thanks, Che I tend to create 2 sites in IIS, one containing the host-header www.mydomain.com, this one contains the site, then the other site created contains all the variations to the host-header, then set the home directory to be a permanent redirection to the first site. HTH 2008/5/5 Che Vilnonis <chevy@asitv.com>: > Is there a way with IIS to automatically redirect traffic from mydomain.com > to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? > > Thanks, Che Why do you do that? Preserving the original domain? On the 'Web Sites' tab of a site's properties there is an Advanced button next to the IP Address field. Here you can specify a number of separate host headers for the same site. (This is for IIS 6. IIS 7 may be different, I haven't played with it yet.) Steve "Cutter" Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _____________________________ http://blog.cutterscrossing.com JediHomer wrote: > I tend to create 2 sites in IIS, one containing the host-header > www.mydomain.com, this one contains the site, then the other site > created contains all the variations to the host-header, then set the > home directory to be a permanent redirection to the first site. > > HTH Just so that all domains and variations for that domain are sent to the full domain name that we use to market that site. We will often but the .co.uk and .net domains but only market the .com. We then get the .co.uk and .net to forward to the .com 2008/5/7 Cutter (CFRelated) <cold.fusion@cutterscrossing.com>: ----- Excess quoted text cut - see Original Post for more ----- If you're doing your own dns, why not just add another host header for www.domain.com as well? !k Is there a way with IIS to automatically redirect traffic from mydomain.com to www.mydomain.com? Or do I need to purchase a rewrite tool for IIS? Thanks, Che
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||