this is my first time with nginx rewrite,
who can help me convert those rules to nginx sintax?
RewriteRule (economics|sport|gossip|aboutus)+$ index.php?section=$1
RewriteRule (register)+$ $1.php?%{QUERY_STRING}
RewriteCond %{QUERY_STRING} ^p
RewriteRule (economics|sport|gossip)/+$ articles.php?section=$1&%{QUERY_STRING}
thank you
I’m not sure what the purpose of the + is in your original regex. Can there be more than one of the four words? Have you tried matching for just one of those words (i.e. is the problem the “or” part)? Why “break” instead of “last” for the rewrite directive?
Again, I’m not sure what you’re trying to accomplish with the + in this regex. Do you mean
.+(that is, “one or more of any character”)? If so, the $ is superfluous. As you’ve written it, it means “one or more repetitions of the string ‘register’ ending the request string.”