Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having an issue trying to get my mod_rewrite configuration correctly

i have a site:

I would like to rename "oldname" to "newname" resulting in: etc..

So when a user navigates to my site will automatically send them to

I'm not planning on moving my content marketing have asked me to rename the site folder

I would like to mask the request of to

Also if a user navigates from index.php to an link of say /oldname/project1/index.Php the final browsers returned URL will be /newname/project1.php without having to move or edit site links.

I also understand my hyperlinks will refer to /oldname but this is acceptable

any help would be highly appreciated.


share|improve this question

You want a redirect rule. This is a 301 rule which will cause search engines like Google to perm change the url they use.

RewriteRule ^oldname/index.php$ [R=301,L]
share|improve this answer
So would I need a rule with variables to cover all subpages for example – user64790 Dec 28 '10 at 16:06
Give me an example – Mike Dec 28 '10 at 16:16

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.