wordpress - Why does this 301 redirect results in redirect to wrong url? -
wordpress - Why does this 301 redirect results in redirect to wrong url? -
after relaunching our website, have redirect links to, of them, exclusively new url paths. has lead list of 301 redirects in htaccess posted below. unusual reason though, rules redirect different page written in .htaccess. have searched file other redirect resulting url (which ends in 404, obviously) not formulated.
as example, next 301 redirect ends @ wrong url
removed due seo
this ends at: removed due seo
below total .htaccess:
removed due seo # 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
update:
i think has next setup:
removed due seo
because in first line 'curriculum-vitae-startpagina' changed new structure, automatically redirects scond url before sec rewrite can locate link. solution write exact url '/curriculum-vitae-startpagina/' without childpages affected rewrite.
is there way of doing this?
after long digging found solution myself.
as updated in post, parent folder redirection affecting kid url's, making kid url's no longer match rewrite rule.
to create sure parent folder rewrite not impact kid pages/files, utilize redirectmatch instead of redirect:
redirectmatch ^/folder$ http://example.com/
this create sure folder rewritten, not kid pages/files.
solution source of problem found here
wordpress apache redirect url-rewriting
Comments
Post a Comment