簡體   English   中英

如何在htaccess中將動態網址重定向到相關的靜態網址?

[英]How to redirect dynamic urls to their relevant static urls in htaccess?

動態網址就像

example.com/wp/?2323e=467467
example.com/any-page.html?2323e=567856
example.com/any-folder/other-page.html?2323e=6435346

我想將它們全部重定向到他們的靜態網址

example.com/wp/
example.com/any-page.html
example.com/any-folder/other-page.html

請使用301重定向建議如何執行此操作

要刪除查詢字符串,您可以使用:

RewriteEngine on


RewriteCond %{QUERY_STRING} .+ [NC]
RewriteRule ^ %{REQUEST_URI}? [L,R]

這將重定向:

/foo?querystring

/foo

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM