我在将下面的htaccess规则转换为nginx时遇到了问题。我的网站是用PHP编写的。如何为Nginx创建SEO网址
RewriteEngine叙述在
重写规则^。?([A-ZA-Z0-9 - /] +)的html $ fullstory.php URL = $ 1
重写规则^([A-ZA-Z0- 9 - /] +),HTML/$ fullstory.php URL = $ 1
我试图做的是转换这个URL http://example.com/blog/fullstory.php?url=african-vegetable-recipe.html到http://example.com/blog/african-vegetable-recipe.html
OR
获得“非洲vegetable-? RECI从example.com/blog/african-vegetable-recipe.html获得“pe.html”并用作查询字符串。
nginx能处理这个吗?
我正在使用PHP。我想要做的是将此网址http://example.com/blog/fullstory.php?url=african-vegetable-recipe.html转换为http://example.com/blog/african-vegetable-recipe html的。 nginx能处理这个吗? – tokjohn
我已经更新了与Apache配置相同的Nginx的原始答案。 –