URL Rewrite伪静态规则转换工具,支持Apache、Lighttpd和Nginx

不可思议,将URL Rewrite规则正向或反向转换,适用于Apache,Lighttpd,IIS,Nginx环境下伪静态。

URL RewriteRule conversion tool | URL伪静态规则转换工具
http://www.onexin.net/rewrite.php

Nginx rewrite references e.g.

rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;

Apache rewrite e.g.

RewriteRule ^store-([0-9]+)\.html$ store.php?id=$1 [L,NC]
IIS rewrite (WordPress)
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Apache rewrite (WordPress)

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Nginx rewrite (Wordpress)

location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}

相关文章:

1、CentOS 7.x 系统yum环境搭建PHP 7.x + Apache 2.4 + MariaDB 10.x
https://www.onexin.net/solution/centos-7-x-php-7-x-apache-2-4-mariadb-10-x/

2、CentOS 8.2 服务器上yum安装Apache+Php+MariaDB+MongoDB
https://www.onexin.net/latest/centos-8-2-yum-apache-php-mariadb-mongodb/

3、Struts 2 安全漏洞层出不穷为哪般?
https://www.onexin.net/labs/struts-2-security-vulnerabilities-endless-sorts/

4、Apache多站点配置 多虚拟目录 多端口(终极篇)
https://www.onexin.net/solution/apache/apache-multi-site-configuration/

5、Apache rewrite 详解
https://www.onexin.net/solution/rewrite/apache-rewrite-detailed/

转载请注明出处:https://www.onexin.net/latest/rewrite-rules-for-pseudo-static-conversion-tools-support-apache-lighttpd-and-nginx/

5 Replies to “URL Rewrite伪静态规则转换工具,支持Apache、Lighttpd和Nginx”

      1. 谢谢king, 刚刚又试了几次, 好像是部分.htaccess文件可以转换,部分没有反应。之前一直拿一个文件试的。那这种没反应的情况该怎么转换,呵呵。

Leave a Reply

Your email address will not be published. Required fields are marked *