Htaccess redirecting subitems and files

Avatar
  • Answered
Hi, I would like with one rule to redirect everything from en/directory/ to de/directory
That includes en/directory/ itself and any other sub-directory and/or item

example:
en/directory/ to de/directory
en/directory/subdirectory/ to de /directory/subdirectory/
en//directory/subdirectory/something.html to de//directory/subdirectory/something.html

is that possible?
thanks
Avatar
Arn
Hello, Thanks for the question about changing your .htaccess file to redirect subitems and files. You would use the first rule in the Setting up a permanent 301 redirect via .htaccess tutorial. You would need to need simply modify the rule to include your folder names instead of just the file name. The rule would look like this: Redirect 301 /FOLDER1 /file.htm /FOLDER2/file.htm You would replace the FOLDER1, FOLDER2 and file.htm with your specific information, of course. If you have any further questions or comments, please let us know. Regards, Arnel C.