^([0-9]|[1-8][0-9]|9[0-9]|1[01][0-9]|12[0-7])$
^([1-9]?\d|1[01]\d|12[0-7])$
$str = "-rw-r--r-- 1 ftp ftp 57815 Feb 27 2019 123 4 длинное название файла.docx";
var_dump(explode(' ', $str, 9));
location = / {
root /usr/share/nginx/html;
rewrite ^ /index.html break;
}
$str = 'key1 p1, p2 ,p3 key2 p4,p5';
$m = preg_split('~(key1|key2)~', $str, -1, PREG_SPLIT_DELIM_CAPTURE);
for ($i = count($m) - 1; $i >= 2; $i-=2) {
$result[$m[$i-1]] = $m[$i];
}
print_r($result);
/* Array
(
[key1] => p1, p2 ,p3
[key2] => p4,p5
)
*/
$str = 'key1 p1, p2 ,p3 key2 p4,p5';
preg_match_all('~(key1|key2)(.*?)(?=$|(?1))~', $str, $m);
$result = array_combine($m[1], $m[2]);
print_r($result);
location = /api/servertime {
access_log off;
rewrite ^ /index.php break;
include fastcgi.conf;
fastcgi_pass php;
}
location ~ \.php$
location ~ \.php$ {
if ($request_uri ~ "^/api/servertime") {
access_log off;
}
include fastcgi.conf;
fastcgi_pass php;
}
access_log путь [формат [if=условие]];
map $request_uri $loggable {
default 1;
~^/api/servertime 0;
}
server {
# ...
root /var/www/lumen/public;
try_files $uri $uri/ /index.php$is_args$args;
# ...
location ~ \.php$ {
access_log /var/log/nginx/access.log combined if=$loggable;
include fastcgi.conf;
fastcgi_pass php;
}
}
<VirtualHost *:80>
DBDriver mysql
DBDParams "dbname=test user=root pass=xxxxxx"
RewriteMap user2id "dbd:select id from users where name = %s "
RewriteEngine On
RewriteRule ^/user2id/([^/]+) http://domain.com/id/${user2id:$1} [R,L]
php_admin_value open_basedir /home/admin/web/cloud.site.com/public_html:/home/admin/tmp
php_admin_value open_basedir /home/admin/web/cloud.site.com/public_html:/home/admin/tmp:/home/admin/web/cloud.site.com/public_shtml
RewriteRule ^([^/]+/results,[^/]+)$ /component/virtuemart/search/$1 [R=301,L]
'#^([a-z]+\s[a-z]+|[а-яё]+\s[а-яё]+)$#ui'
'#^[a-z]+\s[a-z]+$|^[а-яё]+\s[а-яё]+$#ui'
'#^([a-z]+)\s(?1)$|^([а-яё]+)\s(?2)$#ui'
RewriteCond %{THE_REQUEST} /subdomains/[^/] RewriteRule ^subdomains/[^/]+/(.*) /$1 [R=permanent,L] RewriteCond %{HTTP_HOST} ^(.+)\.site\.ru$ [NC] RewriteCond %{HTTP_HOST} !^www\.site\.ru$ [NC] RewriteCond %{REQUEST_URI} !^/subdomains RewriteRule ^(.*) %{HTTP_HOST}$1 RewriteRule ^(www\.)?(.+)\.site\.ru(.*) /subdomains/$2%{REQUEST_URI} [L]
RewriteCond %{THE_REQUEST} /subdomains/
RewriteRule ^subdomains/([^/]+)/(.*) http://$1.site.ru/$2 [R=301,L]
RewriteCond %{HTTP_HOST} ^(?>www\.|)(.+)\.site\.ru$ [NC]
RewriteRule !^subdomains /subdomains/%1%{REQUEST_URI} [L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.|)site\.ru$ [NC]
RewriteCond %{REQUEST_URI} ^/([^/]+)
RewriteRule ^(.*)$ http://%1.stie.ru/$1 [R=301,L]
location ~ ^/c/(?!index\.php|d\.php|t\.js|app/project/_resource/s/|app/project/[^/]+/js/c\.min\.js) {
return 403;
}
location ^~ /c/ {
return 403;
location ~ ^/c/(index|d)\.php {
fastcgi_pass ...;
include fastcgi_params;
}
location = /c/t.js { }
location /c/app/project/_resource/s/ { }
location ~ ^/c/app/project/[^/]+/js/c\.min\.js { }
}