简体   繁体   中英

Preventing google(search engines) to indexing specific view of my codeigniter website

I'm using following text in robots.text which resides in root of my website currently to hiding view.php from google.

User-agent: *
Disallow: /application/views/view.php

Am i doing it correct or i have to write controller path like following

User-agent: *
Disallow: /index.php/mycontroller/function

You will need to reference the URL rather than the path to the file. So in your case the correct way is

User-agent: *
Disallow: /index.php/mycontroller/function

Yes, Pattle is right about the URL referencing as the folders are usually not indexed directly, they get indexed when they are found in a page, whereas the application folder shouldn't even be accessible via browser/internet. So thumbs up to:

User-agent: *
Disallow: /index.php/mycontroller/function
Disallow: /mycontroller/function

in case you remove "index.php" from config.php file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM