.htaccess中重定向的URL与匹配的字符串字符串、重定向、htaccess、URL

由网友(伤感在游骋)分享简介:在oldtoys需要301重定向帮助所有字符串匹配'开始'参数生成的不正确的URL http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&start=45&limitstart=300http://www.abc.com/ind...

在oldtoys需要301重定向帮助所有字符串匹配'开始'参数

生成的不正确的URL

http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&start=45&limitstart=300 http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&start=30&limitstart=275 http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&start=15&limitstart=250 301重定向怎么做

正确的网址

http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&limitstart=300 http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&limitstart=275 http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&limitstart=250

这仅适用于旧玩具部件 可以在其上有人帮忙

解决方案

使用mod_rewrite:

  RewriteEngine叙述上
的RewriteCond%{QUERY_STRING} ^(选项= com_oldtoys及放大器; *)及开始= [0-9] + $(*)。
重写规则^指数 .PHP $ /index.php?%1%2 [L,R = 301]
 

Need help on 301 redirection for all string matches 'start' parameter in oldtoys

Incorrect URL been generated

http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&start=45&limitstart=300
http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&start=30&limitstart=275
http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&start=15&limitstart=250

Correct URL

http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&limitstart=300
http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&limitstart=275
http://www.abc.com/index.php?option=com_oldtoys&view=category&Itemid=2&limitstart=250

This only pertains to old toys component Can someone help on it

解决方案

Using mod_rewrite:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^(option=com_oldtoys&.*)&start=[0-9]+(.*)$
RewriteRule ^index.php$ /index.php?%1%2 [L,R=301]

阅读全文

相关推荐

最新文章