Im very bad in regexps, but in server-configs im the worst. So any help ll be usefull.
have such in nginx-config
location / {
rewrite ^(.*[^/])$ $1/ permanent;
try_files $uri $uri/ /index.php?$args;
}
need EQUAL thing for .htacces. Ty.
They should prove very similar.
<IfModule mod_rewrite.c>
RewriteEngine On
# Your web directory root
RewriteBase /
#Make sure it's not a specific file or directory that they're trying to reach
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*[^/])$ index.php?args=$1 [NC, L]
</IfModule>
This will:
The [NC, L] flags tell the rule to be not case sensitive and tell Apache this is the last redirection rule, respectively.
I have to admit, I'm not sure what your Regex is testing for though. Would you mind explaining the URL scheme you want to put in place? I should be able to help you formulate the Regex properly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.