.htaccess文件写法:
复制代码 代码如下:
#-------------- .htaccess start ---------------
rewriteengine on
rewriterule !.(js|ico|gif|jpg|png|css教程|swf|htm|txt)$ index.php
php_flag magic_quotes_gpc off
php_flag register_globals off
#-------------- .htaccess end ---------------
重写功能引入:让站点根目录的index.php末尾写上下列代码,重写就开启了(正常条件:1.apache的重写配置成功,且开启了.htaccess支持的.2.站点根目录的.htaccess文件设置好了.3.class.rewrite.php类文件在index.php前面部分加载了.4.页面模块文件位置及写法无误):
复制代码 代码如下:
//............
rewrite::__config(
$config['path'],/*'http://xxxxx/mysite/'url基础位置*/
$config['md_path'],/*'c:/phps教程ite/www/mysite/modules/'模块文件物理目录*/
array(
'phpinfo'
)
);
rewrite::__parse();
//..........
模块文件写法:
testpk.php
复制代码 代码如下:
class.rewrite.php;
复制代码 代码如下:
