|
配置规则前,请确认您的服务器支持伪静态,或相应的模块已开启。
phpdisk V-Core 6.8
Apache伪静态:- RewriteEngine On
- RewriteRule ^file-([0-9]+)\.html$ viewfile.php?file_id=$1 [NC]
- RewriteRule ^downfile-([0-9]+)\.html$ downfile.php?file_id=$1 [NC]
- RewriteRule ^space-(.+)\.html$ space.php?username=$1 [NC]
- RewriteRule ^public-([0-9]+)-([0-9]+)\.html$ public.php?pid=$1&cate_id=$2 [NC]
- RewriteRule ^public\.html$ public.php [NC]
复制代码 IIS伪静态:
- [ISAPI_Rewrite]
- # 3600 = 1 hour
- CacheClockRate 3600
- RepeatLimit 32
- # Protect httpd.ini and httpd.parse.errors files
- # from accessing through HTTP
- RewriteRule ^(.*)/file-([0-9]+)\.html$ $1/viewfile\.php\?file_id=$2 [I]
- RewriteRule ^(.*)/downfile-([0-9]+)\.html$ $1/downfile\.php\?file_id=$2 [I]
- RewriteRule ^(.*)/space-(.+)\.html$ $1/space\.php\?username=$2 [I]
- RewriteRule ^(.*)/public-([0-9]+)-([0-9]+)\.html$ $1/public\.php\?pid=$2&cate_id=$3 [I]
- RewriteRule ^(.*)/public\.html$ $1/public\.php [I]
复制代码 Nginx伪静态:- rewrite ^(.*)/file-([0-9]+)\.html$ $1/viewfile.php?file_id=$2 last;
- rewrite ^(.*)/downfile-([0-9]+)\.html$ $1/downfile.php?file_id=$2 last;
- rewrite ^(.*)/space-(.+)\.html$ $1/space.php?username=$2 last;
- rewrite ^(.*)/public-([0-9]+)-([0-9]+)\.html$ $1/public.php?pid=$2&cate_id=$3 last;
- rewrite ^(.*)/public\.html$ $1/public.php last;
复制代码 phpdisk V-Core 6.5
Apache伪静态:- RewriteEngine On
- RewriteRule ^file-([0-9]+)\.html$ viewfile.php?file_id=$1 [NC]
- RewriteRule ^viewfile-([0-9]+)-([a-z0-9]*)\.html$ downfile.php?action=view&file_id=$1&file_key=$2 [NC]
- RewriteRule ^downfile-([0-9]+)-([a-z0-9]*)\.html$ downfile.php?file_id=$1&file_key=$2 [NC]
- RewriteRule ^space-(.+)\.html$ space.php?username=$1 [NC]
复制代码 IIS伪静态:
- [ISAPI_Rewrite]
- # 3600 = 1 hour
- CacheClockRate 3600
- RepeatLimit 32
- # Protect httpd.ini and httpd.parse.errors files
- # from accessing through HTTP
- RewriteRule ^(.*)/file-([0-9]+)\.html$ $1/viewfile\.php\?file_id=$2 [I]
- RewriteRule ^(.*)/viewfile-([0-9]+)-([a-z0-9]*)\.html$ $1/downfile\.php\?action=view&file_id=$2&file_key=$3 [I]
- RewriteRule ^(.*)/downfile-([0-9]+)-([a-z0-9]*)\.html$ $1/downfile\.php\?file_id=$2&file_key=$3 [I]
- RewriteRule ^(.*)/space-(.+)\.html$ $1/space\.php\?username=$2 [I]
复制代码 Nginx伪静态:- rewrite ^(.*)/file-([0-9]+)\.html$ $1/viewfile.php?file_id=$2 last;
- rewrite ^(.*)/viewfile-([0-9]+)-([a-zA-Z0-9]*)\.html$ $1/downfile.php?action=view&file_id=$2&file_key=$3 last;
- rewrite ^(.*)/downfile-([0-9]+)-([a-zA-Z0-9]*)\.html$ $1/downfile.php?file_id=$2&file_key=$3 last;
- rewrite ^(.*)/space-(.+)\.html$ $1/space.php?username=$2 last;
复制代码 |
|