Rewrites need to come before the WordPress RewriteEngine.
Wrong
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !–f
RewriteCond %{REQUEST_FILENAME} !–d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteRule ^example_folder/$ https://pagecrafter.com/website-design/ [R=301,L]
|
Right!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# Rewrite Rules go BEFORE the WordPress Section
RewriteRule ^example_folder/$ https://pagecrafter.com/website-design/ [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !–f
RewriteCond %{REQUEST_FILENAME} !–d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
|
Resources: https://pagecrafter.com/htaccess-file-redirects-never-work/