Home > PHP Framework > YII > body text

How to hide index.php in yii 1.0

藏色散人
Release: 2023-01-13 00:40:36
Original
6060 people have browsed it

How to hide index.php in yii1.0: first open the "httpd.conf" file; then open "mod_rewrite.so"; then change the "AllowOverride" of the corresponding directory to ALL; finally in index. Create a new .htaccess in the same directory as php.

How to hide index.php in yii 1.0

The operating environment of this article: windows7 system, yii1.0 version, DELL G3 computer

YII 1.0 Hide single entry index.php Set routing and Pseudo-static

Hide index.php

Ensure that LoadModule in the apache configuration file httpd.conf
rewrite_module modules/mod_rewrite.so is turned on (remove #)
Change the AllowOverride of the corresponding directory to ALL
Create a new .htaccess in the root directory, that is, in the directory at the same level as index.php

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
Copy after login

Set the routing rules in main.php

// uncomment the following to enable URLs in path-format
		'urlManager'=>array(
			'urlFormat'=>'path',
            'showScriptName' =>false,
			'rules'=>array(
                'index.html'=>array('index'),
                'article/' => array('article/index','urlSuffix'=>'.html'),
                'category//' => array('category/index','urlSuffix'=>'.html'),
                'category//1' => array('category/index','urlSuffix'=>'.html'),
			),
		),
Copy after login

Recommended: "yii tutorial"

The above is the detailed content of How to hide index.php in yii 1.0. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
yii
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!