【发布时间】:2016-10-17 05:52:27
【问题描述】:
我正在尝试通过此代码重写 url:
location ~ /canada1/[A-Za-z0-9-_]+/.* {
rewrite ^/canada1/([A-Za-z0-9-_]+)/.* /atemplates/weather/weather_forecast.php?region=$1&location=$arg_db last;
}
有了这个网址:
/canada1/bc_british_columbia/weather.php?db=90
我已将问题范围缩小到 .php 部分。无论我坚持在那里更换它都可以按预期工作,即 .phd .phq .abcdefg ... 工作正常。我需要做什么才能用那个 .php 扩展名重写那个东西?
感谢您的帮助。
参考:How to rewrite old url with a period, question mark and equals in it?
【问题讨论】:
标签: php nginx url-rewriting