.htaccess htaccess通过301重定向从url中删除字符串

.htaccess htaccess通过301重定向从url中删除字符串,.htaccess,redirect,.htaccess,Redirect,需要帮助从url中删除此字符串吗 index....</div></images/myblog_images/978 正确的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 http://www.abc.com/index.php?option=

需要帮助从url中删除此字符串吗

  index....</div></images/myblog_images/978
正确的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
http://www.abc.com/index.php?option=com_news&view=detail&n_id=20&Itemid=4
非常感谢

编辑

你好,阿努巴夫 应用htaccess条件时-url已更改为

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]
您可以尝试以下代码:

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

嗨,Anubhava,它显示页面错误,因为这个网页有重定向循环。另外-重定向时-url已更改-我在edit中提到它,因此您不希望外部重定向,仍然希望显示
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
URL在浏览器中?谢谢,我想它会删除index.php之前的所有代码。希望那很好!!是的,它会在index.php之前剥离文本,如果您想让它更具针对性,而不是?使用index.+?嗨,Anubhava,我已经将服务器更改为hostgator,并且此代码-重写规则^.+?(index\.php)$/$1[L,NC,R=301]-不再工作。由于服务器上的相同获取404错误。是否有其他方法使其工作Hi Anubhava,它显示页面错误,因为此网页有重定向循环。另外-重定向时-url已更改-我在edit中提到它,因此您不希望外部重定向,仍然希望显示
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
URL在浏览器中?谢谢,我想它会删除index.php之前的所有代码。希望那很好!!是的,它会在index.php之前剥离文本,如果您想让它更具针对性,而不是?使用index.+?嗨,Anubhava,我已经将服务器更改为hostgator,并且此代码-重写规则^.+?(index\.php)$/$1[L,NC,R=301]-不再工作。由于服务器上的相同获取404错误。有没有别的办法让它工作