Apache 如何使用Mod Rewrite在301重定向后从URL中删除参数?

Apache 如何使用Mod Rewrite在301重定向后从URL中删除参数?,apache,.htaccess,mod-rewrite,redirect,Apache,.htaccess,Mod Rewrite,Redirect,我正试图修改一些重写。301重定向正在工作,但它向URL添加了一个新参数 重定向触发后的电流输出为: 我们希望有以下输出: 当前.htaccess代码 RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.exampelpage\.com$ RewriteRule (.*) http://exampelpage.com/$1 [R=301,L] #blog RewriteRule ^blog/([^/]*)$ /index.php?currentp

我正试图修改一些重写。301重定向正在工作,但它向URL添加了一个新参数

重定向触发后的电流输出为:

我们希望有以下输出:

当前.htaccess代码

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.exampelpage\.com$
RewriteRule (.*) http://exampelpage.com/$1 [R=301,L]

#blog
RewriteRule ^blog/([^/]*)$ /index.php?currentpage=$1 
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?sideID=$1 
RewriteRule ^([a-åA-Å0-9_!-]+)/([a-åA-Å0-9_!-]+)/([a-åA-Å0-9_!-]+)$ index.php?sideID=$1&id=$2&title=$3 [L]

#admin
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ index.php?sideID=$1&subpage=admin/$2 [L,QSA]
RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
RewriteRule .* – [F,L]
ErrorDocument 404 http://exampelpage.com/404


# Permanent URL redirect
Redirect 301 /oldpage?__hstc=113653464.efdd41a653140fecad23cdf89637a97c.1426377600080.1426377600081.1426377600082.1&__hssc=113653464.1.1426377600083&__hsfp=59720947 http://exampelpage.com/new-page
Redirect 301 /oldpage http://exampelpage.com/new-page

您可以使用重写规则

RewriteRule ^(.*)oldpage?__hstc=(.*)$ /oldpage [R=301,L]

重写规则仅适用于字符串

谢谢,但那没什么用。我知道这不容易解释,但是我们的系统添加的是URL末尾的pageID。我们只是想删除该部分,这只有在重定向完成后才会发生。