× Here you can get community support related to ReDJ.

Ridirezionare URL con /component/content/article e

More
9 years 1 month ago #3726 by Lucc
Salve

qualcuno sa come impostare il ridirezionamento di una URL del tipo

www.miosito.com/component/content/article.html?id=30

in

www.miosito.com/30-articolo.html

e questa

www.miosito.com/index.php?option=com_content&view=article&id=30

in

www.miosito.com/30-articolo.html

non capisco come fare....

ma si potrebbe fare anche con un semplice redirect 301?

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #3728 by admin
Hi,
you can create two rules as follow:
From URL: ^/component/content/article\.html\?id=30$
To URL: {scheme}://{siteurl}/30-articolo.html
Request only: true (checked)

And:
From URL: ^/index\.php\?option=com_content&view=article&id=30$
To URL: {scheme}://{siteurl}/30-articolo.html
Request only: true (checked)

Please, post your question in english (this forum is english only).

Kind regards
The following user(s) said Thank You: Lucc

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #3730 by Lucc
Thank you.

just for "learning purposes" I'd like to know the equivalent Redirect 301 syntax, if you can tell me.

Kind regards

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #3731 by admin
I guess you mean .htaccess redirection. If so there are some options, the simplest one is to use mod_alias (you have simple URLs so there's no need to use regular expressions or mod_rewrite). This should work:
Redirect permanent /component/content/article.html?id=30 http://www.miosito.com/30-articolo.html

Best regards

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #3732 by Lucc
hi, unfortunately it's not working. I've checked many times in order to see if I made any synthax error but I didn't

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #3735 by admin
Hi,
the problem could be the query string, so try this (it works on my env):
RewriteEngine On
RewriteCond %{QUERY_STRING} id=30
RewriteCond %{REQUEST_URI} /component/content/article.html
RewriteRule ^(.*)$ http://www.miosito.com/30-articolo.html [L]

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

Time to create page: 0.096 seconds