Page 1 of 1

Redirect all request to example.com/pics to pics.example.com

New postPosted: 12 Jan 2008 16:06
by zylox
Hi!

I would like to create a Rewrite rule which will forward all requests from http://example.com/pics to http://pics.example.com including all arguments. So if someone goes to http://example.com/pics/gallery1/image1.jpg.html it should also be redirected to http://pics.example.com/gallery1/image1.jpg.html

How can I achieve this? I've searching for hours but couldn't find a solution yet.

Any help will be greatly appreciated!

New postPosted: 13 Jan 2008 13:09
by zylox
The solution:

Code: Select all
RewriteEngine On

RewriteRule ^pics$  http://pics.example.com [R,NC]
RewriteRule ^pics/(.*)  http://pics.example.com/$1  [R,NC]