NGINX漂亮的URL重写-获取参数值并重写到值页面

时间:2018-08-01 13:27:26

标签: redirect nginx indexing parameters url-rewriting

我想将domain.tld / index.php?a = value重写为domain.tld / value

例如

domain.tld / index.php?a =与domain.tld / contact的联系

domain.tld / index.php?a =最新到domain.tld / latest

以此类推...

有什么想法怎么做?

Apache规则如下:

RewriteRule ^(.*) $1 [L]

RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$  index.php?a=$1&q=$3    [L]

1 个答案:

答案 0 :(得分:0)

已解决

if sestatus | grep -q disabled; then
    yum -y install selinux-policy selinux-policy-targeted policycoreutils-python
fi