0

I want to block http urls from indexing ,I want https urls only be indexed by googlebots,

I have tried this code in htaccess file but its not working[blocking

#blocking http urls from indexing
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^robots.txt$ robots-deny-all.txt [L]

I wrote this code inside robots-deny-all.txt

User-agent: *
Disallow: /

appreciate your help

3
  • Please edit your question (there is an edit button below it): replace those links to images by the actual code you include in the question. There are reasons why the rules on this place explicitly requests that for all questions. Thanks. Commented Aug 12, 2023 at 7:52
  • i tried i dont know why it becomes links i used image little icon to upload screenshots Commented Aug 12, 2023 at 9:47
  • As said: code is code, a screenshot is something else. Screenshots are offered to allow for optical impressions, for example for stylesheet stuff. Commented Aug 12, 2023 at 10:23

1 Answer 1

0

only you have to wait for one week to see result , the code works well

in case you wanted to block https replace 80 by 443

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.