3', PHPWEB:'php.cn', settings:'settings', FullScreen:'Full Screen', Speed:'Speed', BrainwashingLoop:'Loop', speedNormal:'Normal', click_to_see:'Click to see full code for direct edit', nextSection:'Next Section', Cancel:'Cancel', Confirm:'Confirm', all_lang_string:'zh|en|zh-tw|ja|ko|ms|fr|de', Next:'Next', Previous:'Previous', };
Home > php教程 > php手册 > body text

yii url 隐藏index.php的步骤

WBOY
Release: 2016-06-06 19:49:33
Original
1332 people have browsed it

一。修改config/下的main.php里的 'urlManager'= array ( 'urlFormat'='path', span style="color:#e53333;"'showScriptName'= false ,/span 'rules'= array ( 'controller:\w+/id:\d+'='controller/view', 'controller:\w+/action:\w+/id:\d+'='controller/

一。修改config/下的main.php里的

'urlManager'=><span>array</span><span>(
            </span>'urlFormat'=>'path',
            <span style="color:#e53333;">'showScriptName'=><span>false</span>,</span>          <br>   'rules'=><span>array</span><span>(
            </span>'<controller:>/<id:>'=>'<controller>/view',
            '<controller:>/<action:>/<id:>'=>'<controller>/<action>',
            '<controller:>/<action:>'=>'<controller>/<action>',<span>
            )</span>,<span>
          )</span>,</action></controller></action:></controller:></action></controller></id:></action:></controller:></controller></id:></controller:>
Copy after login

二。修改网站根目录下.htaccess文件内容如下 

Options +<span>FollowSymLinks
IndexIgnore </span>*<span>/*</span><span>
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php</span>
Copy after login

 三。在wamp中,apeach 中 的http.conf 文件中有个 rewrite, 要打开。

<span>#</span> LoadModule rewrite_module modules/mod_rewrite.so
Copy after login

要将 ‘#’ 给删除。

完成以上三步,就可以在网址 那里,去掉 index.php 隐藏。

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template