Last active
July 19, 2019 13:16
-
-
Save Thomas-A-Reinert/fac70891a815c3a2b95be6615aabef51 to your computer and use it in GitHub Desktop.
WordPress 301 redirection from subdirectory installation to other subdirectory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following code will not only affect the subdirectory itself but all content within! | |
# Add it to the top of your .htaccess file BEFORE WordPress´ own rules, starting with "# BEGIN WordPress" | |
# Move from "old"-directory to "new" directory | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^old/(.*)$ /new/$1 [R=301,L] | |
</IfModule> | |
# In case you want to move from a subdir to the root-directory just remove the "new" from the second parameter like this: | |
# RewriteRule ^old/(.*)$ //$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment