简体   繁体   中英

Add WWW at Joomla's URL without redirect to index

I'm using Joomla and I need to add www in all url's from the website.

We have Facebook's Comments Plugin installed , and turns out when you access the website for example: www.mysite.com.br/category/k2-item-500 it shows some comments, but if you access the same page without 'www', the plugin shows different comments because urls are not the same.

What I need is:

When visitors access mywebsite.com/category/page The htaccess automatically add www into the URL.

I've found some solutions but all them despite add WWW as well also redirect to index.php.

Thanks!

This should work as the first rule in your root .htaccess:

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [NE,R=301,L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM