0

I am trying to delete a disallow condition from robots.txt file. This is not located in root or /pub directories.

I can't change it from admin panel because seems like Magento 2.3.0 has a bug on theme edit page.

Github thread for details

Thanks

4
  • Can you give robots.txt link here? Commented Feb 12, 2019 at 5:49
  • Sure, Here is the link mkelectronicsbd.com/robots.txt Commented Feb 12, 2019 at 5:51
  • From the look of your web source robots.txt should be in /pub directory. Please also check .htaccess, if robots.txt is somehow rewrite Commented Feb 12, 2019 at 6:05
  • I have created a new robots.txt file in root directory. newly created file now showing on website. I don't know why! Commented Feb 12, 2019 at 7:53

2 Answers 2

4

It seems your Nginx or Apache is set differently. Try locating the file in var directory. If you have SSH access, run below command to see if there is a robots file on server.

Check if there is a robots file on server locate -c robots.txt

If the result found is greater than 0, it means the file exists on the server. Next, you can run below command to find the location

locate robots.txt

2
  • Found some robots.txt files with this method but that file is missing. Now I have created a new robots.txt file in root directory. newly created file now showing on website. I don't know why! Commented Feb 12, 2019 at 7:53
  • Thanks your answer is helpful and i am using nginx server and i have checked this way and it's showing here prnt.sc/qvh0mg but i want to edit file how can possible ? Commented Jan 31, 2020 at 8:37
0

Magento2.3.5 have a module to return a robots.txt page so is not finically in the server in a location. See Ref: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Robots/Controller/Index/Index.php in execute() method.

Also look in controller Router.php to have an idea!

Hope it helps!

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.