Heather Ritchey
asked on
htaccess redirect url with .html + a directory after it
We have a few odd formed urls that we're trying to redirect. They all look like this but with different 5 letters after the .html, this is how I tried making the redirects work:
redirect 301 /woodinville-carpet-cleani ng.html/UP fMZ/ https://andersoncarpetcleaninginc.com/professional-home-carpet-cleaning-services-woodinville/
They won't redirect though. All the normal urls in the htaccess redirect just fine, so I know there isn't an issue in the file itself. Anyone have a solution to make them redirect as we expect?
Thanks for any help.
redirect 301 /woodinville-carpet-cleani
They won't redirect though. All the normal urls in the htaccess redirect just fine, so I know there isn't an issue in the file itself. Anyone have a solution to make them redirect as we expect?
Thanks for any help.
Try browsing to /woodinville-carpet-cleani ng.html/UP fMZ/ instead of /woodinville-carpet-cleani ng.html/UP fMZ and see if that works.
You could try changing it to:
You could try changing it to:
redirect 302 /woodinville-carpet-cleaning.html/UPfMZ https://andersoncarpetcleaninginc.com/professional-home-carpet-cleaning-services-woodinville/
ASKER
No, that didn't work either. Thanks for trying. We're pretty sure those few were from a long time ago when the site was hacked, so it's ok if the redirects can't be made to work, but it did really get me interested in how to make it work if we needed to deal with it elsewhere.
Have you tried using a RedirectMatch (allows a pattern, for matching) or a RewriteRule?
RewriteRule /woodinville-carpet-cleaning.html/UPfMZ/? https://andersoncarpetcleaninginc.com/professional-home-carpet-cleaning-services-woodinville/ [R=302,L]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you do something wrong with a 301 redirect on a public site, you can (semi) permanently send your traffic elsewhere, with no way of undoing the damage.