0

I just did a 301 and the domain and some pages which have a mirror file path are fine.

But I have one directory which is not going to be part of the new site and I don't know how to redirect the old files that were there.

I need something like this: oldDomain/oldDir/file.php

and I need to make it redirect to

newDomain/differentDir/file.php

Is that possible? What is the 301 redirect rule for that?

update

I just added this rule as suggested by @Itai and it didn't work

redirectMatch permanent ^/outdoors/trees/tanoak.php$ http://www.comehike.com/outdoors/trees/129/Tanoak

any idea why?

  • Are you missing a file at the end of your rule? If that is a directory, use a / at the end. If not, try it as your first rule (in case others have precedence). If it still does not work, check your Apache config to make that .htaccess use is enabled, your .htaccess is readable (permissions) by Apache and it is either in the right path or in its parent path. – Itai Mar 7 '11 at 1:01
1

For each page, you need a redirect like the following in your .htaccess:

redirectMatch permanent ^/oldDir/file.php$ http://www.newdomain.com/differentDir/file.php

Notice you do not use the 'oldDomain', this is implied because the .htaccess you modify has to be on the old domain's server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy