My Scenario:
I want to access my domain www.myexample.com/in, when I try to browse my sub domain site www.myexample.in.
Solution:
I tried the below code in my default.aspx page,
<%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="True" Inherits="umbraco.UmbracoDefault" trace="true" validateRequest="false" %>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.myexample\.in
RewriteRule (.*) http://www.myexample.com/in/$1 [R=301,L]
The direction is works fine.
I want to access my domain www.myexample.com/in, when I try to browse my sub domain site www.myexample.in.
Solution:
I tried the below code in my default.aspx page,
<%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="True" Inherits="umbraco.UmbracoDefault" trace="true" validateRequest="false" %>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.myexample\.in
RewriteRule (.*) http://www.myexample.com/in/$1 [R=301,L]
The direction is works fine.