Redirect URLs using Redirect component or htacess

57 views Asked by At

In Joomla 3.4 want to redirect this page:

https://www.portal-gestao.com/component/k2/1422-como-i...%C3%A9tica-na-sua-empresa.html

To this:

https://www.portal-gestao.com/item/1422-como-i...%C3%A9tica-na-sua-empresa.html

Using Compontent - > Redirect, I added the following redirect:

/component/k2/1422-como-i...ética-na-sua-empresa.html

Redirect to:

https://www.portal-gestao.com/item/1422-como-i...%C3%A9tica-na-sua-empresa.html

But this did not work.

Then I added in .htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.portal-gestao.com
RewriteRule ^component/k2/(.*)$ https://www.portal-gestao.com/item/$1 

But this also doesn't work.

Help anyone?

1

There are 1 answers

0
venca On BEST ANSWER

Add redirect flag

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.portal-gestao.com
RewriteRule ^component/k2/(.*)$ https://www.portal-gestao.com/item/$1 [R=301,L]