Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I developed a website and from SEO point of view, the homepage of a website is available under three or more different URLs which accordingly poses a risk of duplicate content, since the same content can be accessed via different URLs.

for eg. my website is opening with below URL

https://www.domain.tld/index.php
https://www.domain.tld/
https://domain.tld/

Exact URL which is needed be like
https://www.domain.tld/

What I have tried:

for achieving the same i am using an .htaccess file with code given below:
RewriteEngine on

#Redirect non-www domain to www
RewriteCond %{HTTP_HOST} ^insider\.in$ [NC]
RewriteRule ^ https://www.domain.tld%{REQUEST_URI} [NE,L,R=301]
 #Redirect /index.php to /
RewriteCond %{REQUEST_URI} ^/index\.php$
RewriteRule ^ https://www.domain.tld/ [L,R=301]
I tried to redirect all duplicate URLs to one URL using the above .htaccess file code but it is not working, also I enabled all the file permissions in FileZilla but again no success.

Any help or reference will be appreciated, thank you!

note- website is hosted in cloud server using FileZilla
Posted
Updated 12-Aug-21 22:06pm
v2
Comments
Richard Deeming 13-Aug-21 4:07am    
I've replaced your domain name with a dummy domain, since having multiple references to your actual domain made your question look like spam.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900