Reputation: 3784
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.
Upvotes: 0
Views: 68
Reputation: 775
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.
Upvotes: 1