How do we redirect all requests to one domain to a section of another domain?
12,848
In a .htaccess file on the server
Redirect permanent http://www.example.net/index.jsp http://www.example.com/example_section/index.jsp.
Or you can create page at http://www.example.net/index.jsp
page and add
<%
String redirectURL = "http://www.example.com/example_section/index.jsp";
response.sendRedirect(redirectURL);
%>
Or you can write on the same page
<jsp: forward page="http://www.example.com/example_section/index.jsp"/>
This will forward the page.
Author by
daehaai
Updated on June 04, 2022Comments
-
daehaai almost 2 years
We have two domains,
example.com
andexample.net
· We want every request toexample.net
to redirect toexample.com/example_section/index.jsp
. How can we achieve that?