我正在尝试将数据库重写从htaccess directory语句重写到centOS7上的nginx服务器。我们从db的php参数知道它是有效的,比如/UBA/reports/index.php?type=b&name=league_100_home。
有人能帮我们翻译一下需要在nginx conf文件中添加什么才能让domain.ssl.conf正常工作吗?文件所在的文件夹位于/public/UBA/report/
我们尝试对nginx转换站点进行htaccess,但没有成功,并且conf文件无法使用nginx重新启动。下面的代码是目录/public/UBA/report/中的重写规则,它使apache服务器重写并工作。谢谢!
报表URL路径来自$reports_url_path =“/UBA/ reports /”的dbconfig.php文件;
RewriteOptions MaxRedirects=1
RewriteRule ^leagues/(.*)\.html$ '[%REPORTS_URL_PATH]index.php?type=b&name=$1' [L]
RewriteRule ^box_scores/(.*)\.html$ '[%REPORTS_URL_PATH]index.php?type=e&name=$1' [L]
RewriteRule ^coaches/(.*)\.html$ '[%REPORTS_URL_PATH]index.php?type=g&name=$1' [L]
RewriteRule ^game_logs/(.*)\.html$ '[%REPORTS_URL_PATH]index.php?type=f&name=$1' [L]
RewriteRule ^history/(.*)\.html$ '[%REPORTS_URL_PATH]index.php?type=h&name=$1' [L]
RewriteRule ^leagues/(.*)\.html$ '[%REPORTS_URL_PATH]index.php?type=b&name=$1' [L]
RewriteRule ^players/(.*)\.html$ '[%REPORTS_URL_PATH]index.php?type=d&name=$1' [L]
RewriteRule ^teams/(.*)\.html$ '[%REPORTS_URL_PATH]index.php?type=c&name=$1' [L]发布于 2020-04-24 01:44:55
经过反复试验,我们用下面的代码解决了这个问题:
rewrite ^/UBA/reports/box_scores/(.*)\.html$ /UBA/reports/index.php?type=e&name=$1 last;
rewrite ^/UBA/reports/coaches/(.*)\.html$ /UBA/reports/index.php?type=g&name=$1 last;
rewrite ^/UBA/reports/game_logs/(.*)\.html$ /UBA/reports/index.php?type=f&name=$1 last;
rewrite ^/UBA/reports/history/(.*)\.html$ /UBA/reports/index.php?type=h&name=$1 last;
rewrite ^/UBA/reports/players/(.*)\.html$ /UBA/reports/index.php?type=d&name=$1 last;
rewrite ^/UBA/reports/teams/(.*)\.html$ /UBA/reports/index.php?type=c&name=$1 last;https://stackoverflow.com/questions/61388811
复制相似问题