简体   繁体   中英

Will this approach still get these pages indexed by search engines?

I have php modules for two different type of users. In order to prevent someone to access a module directly by guessing: domain.com/modules/user_form.php i am doing the following:

In the module page i am using:

if(!$included){ die("Error"); }

Then in the page where i am including the module:

$included=1;include("module.php");

What this does is that it makes sure that the user can't directly access this and can only see it if its being called in a page.

My question is i am storing these like: domain.com/module.php

So will search engines be able to pick the module files up in search or because they are only being called in member pages and that they have this include code i am using will prevent them from being indexed.


ok let me clarify i bit. these modules are features that should only be allowed if they are called using include(""); so i am saying if i do the $included=1;include(""); then search won't pick it up, right? since it requires to be included in a page rather than it being a stand alone page.

我没有100%跟踪您的问题,但是如果您要输出HTML,那么可以,搜索引擎可以将其提取。

If the modules are files that don't have their own url listed on your web site, or are not manually added to a robots.txt file or manually submitted to a search engine, they will not appear.

This is not however they best way to use an included file that you don't want people to have direct access to (another question altogether)

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