开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜