Hello Friends Can someone please tell me what code I need to place in the redirecting script so that when someone enters [ www.laughternode.com ] the are redirected to a folder within my root directory called [ laughternode.com ]. I'm stuck and I would greatly appreciate any help. Thank You. Note: Mine is not a sub-domain. The tutorial provided by Winhost is for Sub-Domains.
The KB article will also work for a root domain name. It is not only limited to a subdomain name. http://support.Winhost.com/KB/a649/how-to-redirect-a-subdomain-to-a-subdirectory.aspx
Hello Ray I have gone ahead and created a default.aspx file and inside it I have put: Code: <% If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("laughternode.com") ) > 0 Then Response.Redirect("/laughternode.com") End If %> Is the above code right ? Also where do I upload that [default.aspx] to ? Thank You.
Yes this looks about right. And the default.aspx page should be uploaded to your root since that is where the initial http call is made. Also I just want to let you know it is typically bad practice to name a subfolder with a period. laughternode.com It should be named with one word without a period.
Hello Ray I have gone ahead and changed the folder name to [ laughternode ]. Here is my script code right now: Code: <% If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("laughternode.com") ) > 0 Then Response.Redirect("/laughternode") End If %> Where SERVER_NAME is replaced with the name of my server. The problem is the above code does now work. It still redirects me to parent website. (www.jzendev.com) !
What did you use to create this web page? And what do you have in your default.aspx page? Do you only have the redirect script line. When I go to http://laughternode.com/default.aspx nothing comes up and it doesn't get redirect.
Hi Ray. I used Notepad++ to create that page. All that is in it is the what you see above ! As for the folder structure of my root directory, here is a screenshot: What am I doing wrong ?
Try this... Log into the server using IIS 7 Manager. http://support.Winhost.com/KB/a628/using-the-microsoft-iis-70-manager.aspx Once you are logged in go to module labeled “URL Rewrite”. Click on ‘Add Rules…’, and choose ‘Blank rule’ from the Add rule(s) window Type a name for the rule. Make sure you choose ‘Matches the pattern’ in the Requested URL: drop down box and ‘Regular Expression’ in the Using: drop down box. In the Pattern text box type (.*) Click on the button ‘Add Conditions’ then under the drop down box labeled ‘Logical Grouping:’ choose ‘Match Any’ and click on the ‘Add’ button. Type {HTTP_HOST} for Condition input. Type ^mydomain\.com$ in the ‘Pattern:’ text box. Note the carrot sign ‘^’, the forward slash ‘\’, and the dollar sign ‘$’, these are regular expression symbols that you will need to add. Type the pattern just as I lay out. When the conditions are defined, you will be back in the Edit Rule window; choose ‘Rewrite’ in the ‘Action Type:’ drop down box. In the ‘Rewrite URL:’ text box type \sub1\{R:1} Put a check mark next to ‘Append query string’. Click on the Apply. Your rule is now setup. Bear in mind that \sub1\ is the folder where you uploaded your website into and mydomain.com is the domain name you want to filter.
Thanks Ray. I'm trying to login into IIS, but I get an error saying it can't connect [401 Error] ! For Server name what do I put ? Just the 3 letter server name ? or is it something else ? For Username and Pass, I'm using the same ones as the FTP. Thanks
Make sure you choose Connect to Site and not Connect to Server. That is often the common mistake. And use jzendev.com for the server name and site name. laughternode.com is only the domain pointer so the site name for the account will be jzendev.com
Thank You Ray. laughternode.com now works. I still have things to fix on it (so don't be surprised if you get errors). However there is still a slight problem with the Domain Pointer. [ www.laughternode.com ] does not work. Only [ laughternode.com ] works. I need them both to work Thanks PS. What happens when I add a sub-domain ? Do I have to go through all that again ?
If that is the case you will also need to add the condition ^www.laughternode\.com$ Yes, you need to add rules for each of them.
Hi Ray So just to clarify, in order to get my sub-domain working, I need to do the following again: Remember, this time it is a sub-domain. So would I do this for the reg expression >> ^c1taskd\.jzendev\.com$ ? [ c1taskd ] being the name of my sub-domain ? PS. Adding the 2nd condition made [ www.laughternode.com ] work as well. Thank You.