Nayara
By:
Nayara

How I to do redirect in .htaccess in this way?

September 10, 2015 875 views
Apache Linux Basics

How I to do a redirect in .htaccess in this way?

www.domain.com/blog/* --> www.domain2.com/*
www.domain.com/blog/ir/* --> www.domain2.com/ir/*

1 Answer

Add the following to domain.com's .htaccess:

RedirectMatch 301 ^/blog/(.*)$ http://www.domain2.com/$1

Take a look at the following tutorial:

by Justin Ellingwood
HTTP redirects are used to redirect web site visitors to new locations when they request content. These are useful for a variety of reasons, whether permanent or temporary. This guide will demonstrate how to redirect visitors using Apache and Nginx.
Have another answer? Share your knowledge.