Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to redirect a folder and subfolder to different locations within Apache?

For examples, redirect

/images to new-domain.com/images

and

/images/uploads/ to new-domain.com/uploads

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You want to use either a redirect or a rewrite. Have a look at the mod_rewrite docs.

Redirect is easiest. RedirectMatch will let you use a regex to be a bit more flexible:

RedirectMatch permanent /images(/uploads/)? http://www.example.com/images$1
share|improve this answer
    
you are awesome with good solution –  Mughil Dec 31 '11 at 18:36
    
Thank you, James –  DaedBaet Jan 1 '12 at 1:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.