我試圖爲我的用例編寫重寫url。但它不起作用。http重寫不起作用
樣本用戶端URL:
http://frontend1.techdev.local/user1/app/stats/info.png?t=1234
基於請求URI,它需要將請求重定向到不同後端服務器。
例如,
流1: http://frontend1.techdev.local/user1/app/stats/info.png?t=1234 重定向到 http://app1.techdev.local/user1/app/stats/qwezzsdew.png?t=1234
流程2: http://frontend1.techdev.local/user1/app/html5/qweqwrw.png?t=12345 重定向到 http://app1.techdev.local/newuser/app/html5/qweqwrw.png?t=12345
流程3: http://frontend1.techdev.local/usr1/app/code1/123455.png?t=12345 重定向到 http://app1.techdev.local/newuser/app/code1/qweqwrw.png?t=12345
我開始用第一個測試規則,即使那樣也不行。
RewriteRule "^/user1/app/stats/(.*)$" "http://app1.techdev.local/user1/app/stats/$1 [L]"
有人可以請這個
您可以啓用併發布重寫模塊的調試日誌([RewriteLog和RewriteLogLevel](https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog)爲Apache 2.2, [ LogLevel](https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#logging)爲apache 2.4)? –
「不工作」是什麼意思 - 會發生什麼? –