Apache 正在尝试使用htaccess规则修复我的网站上查询字符串中的%3F问题

Apache 正在尝试使用htaccess规则修复我的网站上查询字符串中的%3F问题,apache,.htaccess,mod-rewrite,redirect,Apache,.htaccess,Mod Rewrite,Redirect,我正在我的网站上构建一个Pebble Watchface配置页面,Cloud Pebble为该页面自动生成的URL以%3F结尾: http://andr01dm.com/pebble/faciem/config.html?return_to=https%3A//cloudpebble.net/ide/emulator/config%3F 但此URL在我的站点上导致501方法未实现错误。我发现,如果手动从查询字符串中删除%3F,它将按预期工作 我正在考虑使用htaccess规则将URL更改为以下

我正在我的网站上构建一个Pebble Watchface配置页面,Cloud Pebble为该页面自动生成的URL以%3F结尾:

http://andr01dm.com/pebble/faciem/config.html?return_to=https%3A//cloudpebble.net/ide/emulator/config%3F
但此URL在我的站点上导致501方法未实现错误。我发现,如果手动从查询字符串中删除%3F,它将按预期工作

我正在考虑使用htaccess规则将URL更改为以下内容:

http://andr01dm.com/pebble/faciem/config.html?return_to=cloud
我已经编写了一个规则,它在我测试它的网站工具()中起作用,但在我的网站上不起作用。你能看一下我的规则并告诉我它是否正确吗

RewriteCond %{QUERY_STRING} ^return_to=https://cloudpebble\.net/ide/emulator/config\?$
RewriteRule config.html config.html?return_to=cloud [R=301,L]
我的网站正在运行Apache和ModX Revolution CMS。多谢各位

编辑:这是我网站上完整的.htaccess(减去评论)


这条建议对我有用:

# === remove extra question mark ===
RewriteCond %{QUERY_STRING}  ^(.*)%3F$ [NC]
RewriteRule .* %{REQUEST_URI}?%1 [R,L]

这条建议对我有用:

# === remove extra question mark ===
RewriteCond %{QUERY_STRING}  ^(.*)%3F$ [NC]
RewriteRule .* %{REQUEST_URI}?%1 [R,L]

是的,我已经打开了重写引擎。以下是我的站点的完整(减去注释)htaccess:
AddHandler应用程序/x-httpd-php52.php.php5.php4.php3 RewriteEngine On RewriteBase/RewriteCond%{HTTP_HOST}。重写cond%{HTTP_HOST}^andr01dm\.com[NC]RewriteRule(.*)http://^andr01dm.com/$1[R=301,NE,L]RewriteCond%{QUERY\u STRING}^返回=https://cloudpebble\.net/ide/emulator/config\?$RewriteRule config.html config.html?返回\u to=cloud[R=301,L]RewriteCond%{REQUEST\u FILENAME}-f RewriteCond%{REQUEST_FILENAME}-重写规则^(.*)$index.php?q=$1[L,QSA]
你写了这个(重写引擎打开了)是的,我已经打开了重写引擎。以下是我的站点的完整(减去注释)htaccess:
AddHandler应用程序/x-httpd-php52.php.php5.php4.php3 RewriteEngine On RewriteBase/RewriteCond%{HTTP_HOST}。重写cond%{HTTP_HOST}^andr01dm\.com[NC]RewriteRule(.*)http://^andr01dm.com/$1[R=301,NE,L]RewriteCond%{QUERY\u STRING}^返回=https://cloudpebble\.net/ide/emulator/config\?$RewriteRule config.html config.html?返回\u to=cloud[R=301,L]RewriteCond%{REQUEST\u FILENAME}-f RewriteCond%{REQUEST_FILENAME}-重写规则^(.*)$index.php?q=$1[L,QSA]