Want to achieve the effect is very simple, I have two modules, Home, Wechat.
Http://localhost/index.php/home/index/index shortened to: http://localhost/index/index Http://localhost/wechat/index/index
Hide index.php, this is relatively simple, I opened. htaccess support on the line, the specific configuration to implement Baidu bar, I use the apache2, build a soft connection into
Ln-s/etc/apache2/mods-available/rewrite.load/etc/apache2/mods-enabled/rewrite.load
Restart Service
Then, you don't have to do anything, index.php is hidden.
<mod_rewrite.c>rewriteengine onrewritecond%{request_filename}!- Drewritecond%{request_filename}!-frewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]</ifmodule >
This is the thinkphp default. htaccess file content, you can see that index.php can be omitted
then is the home of the hidden, if we directly in the. htaccess file to write home, then, the other modules we can not access, only use the mechanism provided by thinkphp
There is a lot of talk here, but I find that most of them speak frankly, and none of them are complete.
That's what I'm doing.
Adding a configuration to the common/conf/config.php
Array (' Home ', ' Wechat ')
Where ' module_allow_list ' is the value of all of the module names you allow access to, only the modules that are written in it. Finally, a lot of people say that adding in the index.php
Define (' Bind_module ', ' Home ');
Do not recommend this, such a configuration, your project is only the home module can be accessed, if there are multiple modules??? Does it use the ugly form of m=&c=&a=??
Thinkphp hides Index.php/home and allows access to other modules