1
A
回答
2
像這樣的東西?
# not existing file (images, css, etc)
RewriteCond %{REQUEST_FILENAME} !-f
# no query parameters
RewriteCond %{QUERY_STRING} =""
# not/
RewriteCond %{REQUEST_URI} !^/$
# external redirect and pass along query string and uri as fragment
# i guess this must be an external redirect as the server side should
# not see the fragment, R=redirect, NE=dont escape #, L=last rule
RewriteRule ^(.*)$ /#!/$1 [R,NE,L]
# same but with query parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^(.*)$ /?%{QUERY_STRING}#!/$1 [R,NE,L]
但我不知道這是否好主意。也許你應該在應用程序邏輯或客戶端腳本中進行重定向。
相關問題
- 1. mod_rewrite的,如何改變URL
- 2. mod_rewrite的改變URL路徑
- 3. API URL的mod_rewrite
- 4. mod_rewrite的URL
- 5. mod_rewrite的URL
- 6. mod_rewrite的在URL
- 7. 傳遞變量進入URL
- 8. lighttpd的mod_rewrite的URL
- 9. url掩碼mod_rewrite
- 10. Url重寫mod_rewrite
- 11. Url rewrite mod_rewrite
- 12. Mod_Rewrite爲URL
- 13. mod_rewrite重寫url
- 14. mod_rewrite的動態URL
- 15. URL重寫mod_rewrite的
- 16. URL重寫mod_rewrite的
- 17. PHP中的mod_rewrite樣式URL替換
- 18. 用mod_rewrite替換URL的部分
- 19. 用mod_rewrite改變站點的URL
- 20. mod_rewrite的:在URL可選GET變量
- 21. 用DNS和/或Mod_Rewrite進行URL掩碼?
- 22. URL的最後一部分進入變量使用URL重寫
- 23. 如何將form =「get」轉換爲mod_rewrite url?
- 24. htaccess mod_rewrite URL問題
- 25. .htaccess mod_rewrite URL查詢
- 26. MOD_Rewrite重定向URL
- 27. Mod_Rewrite:在URL中的變量和值之間插入「/」
- 28. mod_rewrite的力小寫的URL
- 29. Mod_rewrite刪除追加的URL
- 30. 更好的URL與mod_rewrite?
這不行! – 2012-01-08 12:36:10
我現在修正了標誌語法,那是什麼沒有工作? – 2012-01-08 13:04:12
當我測試時,它沒有顯示片段部分。我會再試一次,讓你知道。 – 2012-01-08 16:40:00