I have a website learn2hack.io and when i submit to google search console i keep getting errors, first it was duplicate without canonical now its page with redirect error.

i have included <link rel="canonical" href="https://learn2hack.io" /> on my index.php file and i created rules in .htaccess

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

RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteRule ^(.*)index\.php$ /$1 [L,R=301]

I did the redirect in htaccess because chat gpt told me it would fix indexing problems.

how can I get my index page properly indexed? all my other pages seem to be fine except my index.php page file.

1 Answer 1


Your on-page code contains links to https://learn2hack.io/index.php instead of https://learn2hack.io/ - you ideally need to standardise the link format in the code itself.

I'm assuming that Google Search Console is only showing a redirect for /index.php and not the root URL, as I can see the latter is indexed correctly - when I do a site: search it is there.

If you have external backlinks to /index.php then it will likely remain listed in Google Search Console, but be aware that it is just a warning rather than an error. It's worth fixing for professionalism, but you won't get any great ranking benefit for doing so.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.