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.

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

i have a site:

0.0.0.0/oldname/directories/index.php

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

0.0.0.0/newname/directories/index.php etc..

So when a user navigates to 0.0.0.0 my site will automatically send them to 0.0.0.0/oldname/index.php

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 0.0.0.0/oldname/index.php to 0.0.0.0/newname/index.php

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.

Regards

share|improve this question

1 Answer 1

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$ http://0.0.0.0/newname/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

 
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.