1、下载pcre-8.39.tar.gz
2、解压
# tar zxvf pcre-8.39.tar.gz
# cd pcre-8.39
3、编译安装(指定:--enable-utf8 --enable-unicode-properties )
# ./configure --enable-utf8 --enable-unicode-properties
# make
# make install
当安装好pcre后,利用pcretest命令来打印pcre的安装情况,一般输出如下:
复制代码
# pcretest -C
PCRE version 8.39 2016-11-23
Compiled with
8-bit support
UTF-8 support
Unicode properties support
No just-in-time compiler support
Newline sequence is LF
\R matches all Unicode newlines
Internal link size = 2
POSIX malloc threshold = 10
Parentheses nest limit = 250
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack
然后在conf 加入:
location /admin/ { #Change this to your admin folder
if (!-e $request_filename) {
rewrite ^/.*$ /admin/index.php last; #Change this to your admin folder
}
}
location / {
if (!-e $request_filename) {
rewrite ^/.*$ /index.php last;
}
}