How do we redirect all requests to one domain to a section of another domain?
We have two domains, example.com
and example.net
· We want every request开发者_Go百科 to example.net
to redirect to example.com/example_section/index.jsp
. How can we achieve that?
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.
精彩评论