简体   繁体   English

htaccess通过301重定向从网址中删除字符串

[英]htaccess remove string from url by 301 redirect

Need help to strip out this string from url 需要帮助以从网址中删除此字符串

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

Incorrect URL 网址错误

 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

Correct URL 正确的网址

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

Many thanks 非常感谢

Edit 编辑

Hello Anubhav While applying the htaccess condition - the url is been changed to 您好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