问题
I'm trying to redirect:
https://www.portal-gestao.com/item/7736-3-ideias-para-afinar-a-sua-m%C3%A1quina-de-vender-na-internet.html
To:
https://www.portal-gestao.com/artigos/7736-3-ideias-para-afinar-a-sua-m%C3%A1quina-de-vender-na-internet.html
That is: replacing the item
part of the URL.
My code in .htaccess is:
RewriteEngine On
RewriteRule ^.+/item/(.+)$ /artigos/$1 [R=301,L]
Note: this is a Joomla 3 site.
回答1:
Since item
is start of URL you should be using this rule:
RewriteEngine On
RewriteRule ^item/(.+)$ /artigos/$1 [R=301,L,NC,NE]
Make sure to keep this rule at start of your .htaccess just below RewriteEngine On
line.
来源:https://stackoverflow.com/questions/33283968/redirect-part-of-url