.htaccess Nginx+;apache用户友好URL

.htaccess Nginx+;apache用户友好URL,.htaccess,mod-rewrite,apache2,nginx,location,.htaccess,Mod Rewrite,Apache2,Nginx,Location,我想以用户友好的方式重写URL。例如,我需要将一些地址(如mydomain.com/brand/nike)重写为mydomain.com/index.php?section=gallery&brand=nike 因此,我将为.htaccess编写一些重写规则,比如RewriteRule^brand/([^/]+)/?$index.php?section=gallery&brand=1 但是我应该如何为nginx定位,这样我就不仅可以通过.php而且还可以通过/brand/nike传递到apach

我想以用户友好的方式重写URL。例如,我需要将一些地址(如mydomain.com/brand/nike)重写为mydomain.com/index.php?section=gallery&brand=nike 因此,我将为.htaccess编写一些重写规则,比如RewriteRule^brand/([^/]+)/?$index.php?section=gallery&brand=1

但是我应该如何为nginx定位,这样我就不仅可以通过.php而且还可以通过/brand/nike传递到apache地址


我有很多参数需要传递:mydomain.com\cat1\xx\cat2\xx\brand\nike\owner\test

您不需要在web服务器中进行所有疯狂的重写。您可以完成URL的所有解析,并在应用程序中设置所有参数。你唯一需要的重写——将所有不是文件和文件夹的请求重写为index.phpHi,CyberDem0n thx。为了得到答案,你可以发布一些示例(nginx规则将所有请求重写为index.php)。或者你发电子邮件?