SEO
Posted: Fri Nov 11, 2022 9:38 am
Hi Everyone,
I recently started working with an SEO company who offered to help us get our WYSIWYG designed website further up the search engines.
One of the problems they said was that google sees 3 urls for the home page.
https://www.yourdomain.co.uk
www.yourdomain.co.uk
https://www.yourdomain.co.uk/index.php
They suggested we use the following .htaccess file, I’m not how much this has improved our ranking but at least google only sees one url now.
ErrorDocument 404 /index.php
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain.co.uk$ [NC]
RewriteRule (.*) https://www.yourdomain.co.uk/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.?)index\.php/(.*) /$1$2 [R=301,NE,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
I recently started working with an SEO company who offered to help us get our WYSIWYG designed website further up the search engines.
One of the problems they said was that google sees 3 urls for the home page.
https://www.yourdomain.co.uk
www.yourdomain.co.uk
https://www.yourdomain.co.uk/index.php
They suggested we use the following .htaccess file, I’m not how much this has improved our ranking but at least google only sees one url now.
ErrorDocument 404 /index.php
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain.co.uk$ [NC]
RewriteRule (.*) https://www.yourdomain.co.uk/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.?)index\.php/(.*) /$1$2 [R=301,NE,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]