Apache环境
1)开启Apache重写模块,具体请百度,如果使用空间一般空间商默认已经开启;
2)到后台配置参数中开启伪静态开关(老版本直接修改程序config/config.php文件url_type=2);
3)在站点目录建立.htaccess文件(老版本根目录下默认已有,新版本到rewrite目录下拷贝规则),内容如下:
Apache环境
1)开启Apache重写模块,具体请百度,如果使用空间一般空间商默认已经开启;
2)到后台配置参数中开启伪静态开关(老版本直接修改程序config/config.php文件url_type=2);
3)在站点目录建立.htaccess文件(老版本根目录下默认已有,新版本到rewrite目录下拷贝规则)
1.X版本规则如下:
#1.X版本使用如下规则: <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f #如果页面出现"No input file specified." 请注释第一条,启用第二条 RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] #RewriteRule ^(.*)$ index.php [E=PATH_INFO:$1,QSA,PT,L] </IfModule>
2.X版本规则如下:
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f #如果页面出现"No input file specified." 请注释第一条,启用第二条 RewriteRule ^(.*)$ index.php/$1 [QSA,pT,L] #RewriteRule ^(.*)$ index.php [E=PATH_INFO:$1,QSA,PT,L] </IfModule>