Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1920

Search Engine Optimization (Joomla! SEO) in Joomla! 5.x • Re: Duplicate pages problem

$
0
0
You could try:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.sitename\.it [NC]
RewriteRule ^(.*)$ http://sitename.it/$1 [L,R=301]

Added [NC] flag to the RewriteCond directive: This makes the hostname comparison case-insensitive, ensuring that it matches both "www.sitename.it" and "Sitename.it", for example.

Escaped the dots in the domain name: In regular expressions, dots have a special meaning, so they need to be escaped to match literal dots in the domain name.

Added ^ and $ anchors in the RewriteRule pattern: This ensures that the rule only matches requests for the root of the domain (e.g., "www.sitename.it/") and not subdirectories. This helps prevent unintended redirection loops.

Statistics: Posted by CityPop — Tue Mar 19, 2024 2:58 pm



Viewing all articles
Browse latest Browse all 1920

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>