• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
question about sitemap

#1
Hi everybody, i am new in CI and dont know much about coding. i have just started a matrimonial site and buy a matrimonial script from ACTIVE ZONE that developed in CI.

I have placed sitemap.xml file in route folder, but it gives error 404.
Can you give me some suggestion?

Thanks!
Reply

#2
You wrote "route" folder, but I assume you meant "root" folder. Right?

You should not expect to be able to see robots.xml with the browser. Actual robots use cURL, file_get_contents() or other means to read the contents of that file.

Try this snippet to read the contents. It assumes that robots.xml is in the same folder with CI's index.php

PHP Code:
$response file_get_contents('https://yoursite.com/robots.xml');

if (
FALSE === $response)
{
    echo "file_get_contents failed";
    return;
}

echo 
$response;


The display won't be pretty, but you should see the contents.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.