.htaccess - URL structure changed. need to 301 redirect some old .html urls that returns 404 to the root -


i have problem website, after redesign , site structure has dramaticly changed. old pages www.site.com/page.html new 1 managed wordpress , urls without .html in end.

not old pages have been recreated in new site 15-20 of them were, added in htaccess 301 redirects old urls new ones.

the problem have lot of old .html pages don't exist anymore , missing links, juice , traffic because of , redirect remaingin .html pages root domain of new one. don't know rules apply because 20 old .html pages allready redirected , don't want pages redirect root, ones don't exist anymore , returning 404's.

any piece of advice on this? not fammiliar apache if tried find answer online, haven't figured out yet. in advance!

something should work in .htaccess:

rewriterule (*.html) http://www.your.site [r=301,l] 

if have other rules, can add afterwards long have l flag. stop processing rules once 1 matched. e.g.

rewriterule page.html http://www.your.site/page [r=301,l] rewriterule (*.html) http://www.your.site [r=301,l] 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -