Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We have two servers, and some content was moved to our old server, but, there are still some links on the web to those old directories on our old server.

So, any page in I need to rewrite/redirect to So, if anyone accesses any files in the directory they will get the URL rewritten to the older server which is

Am I going about this the wrong way?

share|improve this question
You ask, "am I going about this the wrong way?" I don't know, how are you going about it? What have you tried? Is it working? What web server are you using? – larsks Dec 16 '09 at 0:41

2 Answers 2

If you're using Apache, the mod_alias documentation will probably be helpful. This module provides the Redirect family of commands.

share|improve this answer

If you're rewriting everything under a particular directory, then you can use the Redirect directive:

# In httpd.conf for
Redirect /Pages

That will preserve everything under /Pages and pass it to, i.e., will go to

If you are only rewriting specific files (you said "some content was moved to our old server"), then you'll have to do it on a file-by-file basis. You can use the same Redirect directive, or you can use mod_rewrite; I think Redirect will be simpler for this. Keep in mind that Apache processes Redirect and rewrite directives serially at run time, so if you have a lot of them, it's definitely going to impact performance.

share|improve this answer
That will only redirect /Pages to, not /Pages/foo.html. You need something like Redirect ^/Pages/(.*)$$1 Note also the start and end delimiters for the regex, so something like won't match. – Andy Shellam Feb 16 '10 at 13:17

Your Answer


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.