搜一下xiuno的伪静态规则,全都是复制粘贴。。。太气人了。
下面是也是复制粘贴,但更全面
XiunoBBS 伪静态设置规则:将 *.htm* 转发到 index.php?*.htm*
在nginx配置文件的server节点下新增如下内容:
location ~* \.(htm)$ { rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last; }
修改后重启nginx服务
如果Appache 支持 .htaccess,可以在网站根目录创建文件 .htaccess,内容如下:
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*?)([^/]*)$ $1index.php?$2[QSA,PT,L] </IfModule>
也可以修改httpd.conf,如果将规则直接放入 httpd.conf 则需要在前面加 /
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^(.*?)([^/]*)\.htm(.*)$ $1/index.php?$2.htm$3 [L] </IfModule>
修改web.config
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="xiuno"> <match url="^((.*)/)?(.+).html$" /> <action type="Rewrite" url="{R:1}\index.php?{R:2}.html" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
www.yourdomain.com # Set this path to your site's directory. root * /var/www file_server # Or serve a PHP site through php-fpm: php_fastcgi localhost:9000
如果是SAE开发测试环境,在网站根目录建立 config.yaml 文件,编辑:
appname: axiuno version: 1 handle: - rewrite: if ( !is_dir() && !is_file() && path ~ "admin/(.*.htm)" ) goto "admin/index.php?%1" - rewrite: if ( !is_dir() && !is_file() && path ~ "[^/?].htm" ) goto "index.php?%1"
WDCP是一套Linux下的虚拟主机管理软件,总结下几个要点:
RewriteEngine on RewriteRule ^/admin/([^/]+)\.htm$ /admin/index.php?$1.htm [L] RewriteRule ^/([^/]+)\.htm$ /index.php?$1.htm [L]
修改conf/conf.php,将url_rewrite_on 改成1,然后在后台清理缓存
(以上部分内容来自已关站的xiuno官网)
暂无回复,快来抢沙发吧
版块
人生倒计时
~扫~码~领~红~包~