Redirect part of URL

…衆ロ難τιáo~ 提交于 2019-12-13 19:40:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!