Access test or testb and redirect to www.test.com. How can I write? I wrote RedirectMatch301test. * When www.test.com is accessed, access to testb will be redirected to www. test. comb, but what is actually needed is www.test.com... access/test or/test/B to redirect to the http://www.test.com, how to write?
When I write a RedirectMatch 301/test. * http://www.test.com,
Access to/test/B will be redirected to http://www.test.com/ B, but the website is http://www.test.com.
In addition, how do I write a redirection if a url cannot be matched?
For example, when the request is/admin, no redirection is performed, and all requests except/admin are redirected.
Reply content:
Access/test or/test/B to redirect to the http://www.test.com, how to write?
When I write a RedirectMatch 301/test. * http://www.test.com,
Access to/test/B will be redirected to http://www.test.com/ B, but the website is http://www.test.com.
In addition, how do I write a redirection if a url cannot be matched?
For example, when the request is/admin, no redirection is performed, and all requests except/admin are redirected.
For more information about the Apache Rewrite module, see
Http://man.lupaworld.com/content/manage/Apache2.2_chinese_manual/mod/mod_rewrite.html
301 redirection example
RewriteRule ^ test/B /? $ Http://www.test.com/[L, r= 301]