i am using win 2003 server, i want to redirect domainname.com's all pages to www.domainname.com relevant page. please advice how i can do the same. thanks, hasit
If you have admin access to the IIS server, follow the steps below: 1. Start Internet Services Manager. Alternatively, start the IIS Snap-in in Microsoft Management Console (MMC). 2. Click to expand * server name, where server name is the name of the server. 3. Right-click either the Web site or the folder that you want to redirect, and then click Properties. 4. Click one of the following tabs that is appropriate to your situation: • Home Directory • Virtual Directory • Directory 5. Under When connecting to this resource, the content should come from, click A redirection to a URL. 6. Type the URL of the destination folder or Web site in the Redirect to box. For example, to redirect all requests for http://domain.com/ to http://www.domain.com, type http://www.domain.com. 7. Click OK. If you do not have admin access to the IIS server, do as per your underlying technology of your Windows IIS hosted website: ASP Version: Code: <%@ Language=VBScript %> <% Response.Status="301 Moved Permanently" Response.AddHeader "Location", "http://www.domain.com" %> Code (markup): ASP.NET Version: Code: <script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.domain.com"); } </script> Code (markup): PHP Version: Code: <?php header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.domain.com"); ?> Code (markup):
hi Sufyan, thanks for your prompt reply, i tried to go into my iis manager, and i see the following in home directory, an option "A directory located on this computer" is the option selected and i see all the folder path where my entire website is stored. this is a dedicated server and is loaded with only one website, please advice if i change this to the way you are proposing?
i want to configure it in such a way that all the respecitive page of domainname.com/yahoo.html should go to www.domainname.com/yahoo.com
Try this! RewriteCond %{HTTP_HOST} !^www\.somesite\.com [NC] RewriteRule ^(.*) http://www.somesite.com$1 [L,R=301] Code (markup): this would do and please remove the old 301 that exist and give it a go, but please clear your browser cache first.