簡體   English   中英

htaccess通過301重定向從網址中刪除字符串

[英]htaccess remove string from url by 301 redirect

需要幫助以從網址中刪除此字符串

  index....</div></images/myblog_images/978

網址錯誤

 http://www.abc.com/index....%3C/div%3E%3C/images/myblog_images/978/index.php?option=com_news&view=detail&n_id=20&Itemid=4

正確的網址

http://www.abc.com/index.php?option=com_news&view=detail&n_id=20&Itemid=4

非常感謝

編輯

您好Anubhav在應用htaccess條件時-網址已更改為

http://www.abc.com/home/truecar7/public_html/index.php?option=com_news&view=detail&n_id=20&Itemid=4

您可以嘗試以下代碼:

RewriteRule ^.+?(index\.php)$ /$1 [L,NC,R=301]

暫無
暫無

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

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