Home  >  Article  >  php教程  >  在htaccess文件中隐藏index.php

在htaccess文件中隐藏index.php

WBOY
WBOYOriginal
2016-06-07 11:45:511412browse

仅适用于Apache下面,如果你的Apache已经开启rewrite模块的话(大部分环境都已经开启),可以在.htaccess文件中添加下面代码:<ifmodule><br> RewriteEngine on<br> RewriteCond %{REQUEST_FILENAME} !-d<br> RewriteCond %{REQUEST_FILENAME} !-f<br> RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]<br> </ifmodule>即可实现,把 http://thinkphp.cn/index.php/down地址中的index.php隐藏,利用SEO。

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn