I am looking to write 301 redirects for a site. I would like the redirect to go from http://www.ehlconsulting.com/our-services-basic-services/ to http://www.ehlconsulitng.com/services/.
My .htaccess file is as follow
RewriteEngine On
RewriteCond %{HTTP_HOST} ^ehlconsulting.com
RewriteRule (.*) http://www.ehlconsulting.com/$1 [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
Redirect 301 /our-services-basic-services/ http://www.ehlconsulting.com/services/
When you go to the old URL it doens’t redirect. Instead it shows “Bots get the naked version”
You probably don’t want to use
Redirect
and want to move the actual redirect above your wordpress rules:The “Bots get the naked version” thing doesn’t have to do with your rules, it’s probably WPEngine or something that’s doing that by default, and you might be able to override that by using a
ErrorDocument 404
in your htaccess file. The problem with using aRedirect
along with wordpress’RewriteRule
‘s is that they conflict with each other.