如何通过重定向的.htaccess包含smartquotes一个网址?

编程入门 行业动态 更新时间:2024-10-25 08:17:53
本文介绍了如何通过重定向的.htaccess包含smartquotes一个网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有没有办法来重定向通过的.htaccess包含智能引号中的网址是什么?我用下面的规则。只有最后一个似乎工作:

Is there a way to redirect a URL containing smart quotes via .htaccess? I'm using the following rules. Only the last one seems to work:

RewriteRule ^8-%E2%80%9Crules%E2%80%9D-for-social-advertising$ /8-rules-for-social-advertising [R=301,L] RewriteRule ^8-"rules"-for-social-advertising$ /8-rules-for-social-advertising [R=301,L] RewriteRule ^8-%25E2%2580%259Crules%25E2%2580%259D-for-social-advertising$ /8-rules-for-social-advertising [R=301,L]

当我浏览到 blog.eloqua/8-"rules"-for-social-advertising/ 或的 blog.eloqua/8-%E2%80%9Crules%E2%80%9D-for-social-advertising 不重定向。

When I surf to blog.eloqua/8-"rules"-for-social-advertising/ or blog.eloqua/8-%E2%80%9Crules%E2%80%9D-for-social-advertising it doesn't get redirected.

但是,如果我去的blog.eloqua/8-%25E2%2580%259Crules%25E2%2580%259D-for-social-advertising一切工作就好了。

But if I go to blog.eloqua/8-%25E2%2580%259Crules%25E2%2580%259D-for-social-advertising everything works just fine.

我是什么做错了吗?非常感谢您的帮助!

What am I doing wrong? Thanks so much for your help!

推荐答案

您是对的,它滑倒通过您所提供的规则。

You are right, it's slipping passed the rules you have provided.

究其原因是因为UNI code字再由%E2%psented $ P $ 80%9C和%E2%80%9D(又名微软smartquotes)已经变成了自己的单code再在阿帕奇presentation。因此,你需要正确匹配的字节流重新$ P $中的Apache psenting这些字符。

The reason is because the unicode characters represented by the %E2%80%9C and %E2%80%9D (aka microsoft smartquotes) have already been turned into their unicode representation within Apache. As such you need to properly match the bytestream representing those characters within apache.

为了正确的URL重定向像这样的:

In order to properly redirect urls such as this:

www.example/8-%E2%80%9Crules%E2%80%9D-for-social-advertising

您会使用规则是这样的:

You would use a rule like this:

www.example/8-\xE2\x80\x9Crules\xE2\x80\x9D-for-social-advertising

更多推荐

如何通过重定向的.htaccess包含smartquotes一个网址?

本文发布于:2023-11-01 11:31:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549225.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   网址   htaccess   smartquotes

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!