开发者

How do we redirect all requests to one domain to a section of another domain?

开发者 https://www.devze.com 2022-12-29 06:17 出处:网络
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 o

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

精彩评论

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