I have a website like www.example.com, I want to redirect each hit to this URL and Sub URL to a single URL on subdomain. Following are some examples
www.example.com should be redirected to http://test.example.com
www.example.com/show/mypage1 should be redirected to http://test.example.com
www.example.com/show/mypage2 should be redirected to http://test.example.com
www.example.com/show/mypage3 should be redirected to http://test.example.com
I want to do it using .htaccess. and I want 302 temporary redirect. I am using Apache WebServer.
Are you using Apache or IIS?
In Apache:
edited
edited: replaced
http://test.example.com/$1tohttp://test.example.com/, it works now as required.