My htaccess 301 redirects work if I type the url without a trailing slash like...
www.nicksplumbing.com/water-heater
If I use a trailing slash like...
www.nicksplumbing.com/water-heater/
The redirect adds a trailing slash after the new pages url like .html/ resulting in a 404.
This is a serious issue for me because old Google results have the trailing slash and are being 404'd and not redirected.
Here is my htaccess:
Options +FollowSymLinks
RewriteEngine On
ErrorDocument 404 http://www.nicksplumbing.com/404.html
RewriteCond %{HTTP_HOST} ^nicksplumbingrepair.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.nicksplumbingrepair.com$ [OR]
RewriteCond %{HTTP_HOST} ^nicksplumbing.com
RewriteRule ^(.*)$ http://www.nicksplumbing.com/$1 [L,R=301,NC]
Redirect 301 /plumbing-company-houston http://www.nicksplumbing.com/plumbers-in-houston.html
Redirect 301 /reviews http://www.nicksplumbing.com/houston-plumbing-company-reviews.html
Redirect 301 /leaky-faucet http://www.nicksplumbing.com/leaky-dripping-faucet-repair-houston.html
Redirect 301 /garbage-disposal http://www.nicksplumbing.com/garbage-disposal-repair-installation-houston.html
Redirect 301 /plumbing-repair http://www.nicksplumbing.com/plumbing-services-houston.html
Redirect 301 /repipe http://www.nicksplumbing.com/repipe-house-specialists-houston.html
Redirect 301 /sewer-repair http://www.nicksplumbing.com/sewer-line-repair-houston.html
Redirect 301 /toilet-clogged http://www.nicksplumbing.com/running-leaking-toilet-repair-houston.html
Redirect 301 /water-heater http://www.nicksplumbing.com/water-heater-repair-installation-houston.html
Redirect 301 /blog http://www.nicksplumbing.com/nicks-plumbing-blog.html
Redirect 301 /contact-us http://www.nicksplumbing.com/contacts.html
Can someone please help?! Desperate to find the cause as I don't want to lose any link juice.
Thanks in advance!!!
Needed do a Directory to Html redirect.
RedirectMatch 301 ^/water-heater(.*) http://www.nicksplumbing.com/water-heater-repair-installation-houston.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.