且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用URL .htaccees删除字符串

更新时间:2023-02-23 11:07:49

当你刚刚不小心添加字符串的%20%E2%80%8E 的在创建短链接,那么你就可以刚刚得到另一个短链接不小心再次添加字符串。

When you just accidentally added the string %20%E2%80%8E in the creation of the short link, then you can just get another short link without accidentally added the string again..

不管怎样,我想这些的的.htaccess 的指令是你想要的:

Anyway, I think these .htaccess directives are what you want:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/([a-zA-Z0-9_-]+)\%20\%E2\%80\%8E$
RewriteRule ^(.*) http://medien-mittweida.de/%1 [R,L]

这将重定向的 medien-mittweida.de/的 $什么%20%E2%80%8E 的成的 medien-mittweida.de / $ 什么

It will redirect medien-mittweida.de/$anything%20%E2%80%8E into medien-mittweida.de/$anything

只要确保有 Apache HTTP服务器的mod_rewrite 您的网络托管帐户。并认为有关 [R = 301] 标记此链接:http://***.com/a/15999177/2007055

Just make sure that there's Apache HTTP Server with mod_rewrite on your web hosting account. And considered this link about the [R=301] flag: http://***.com/a/15999177/2007055

这code:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/([a-zA-Z0-9_-]+)/\%20\%E2\%80\%8E$
RewriteRule ^(.*) http://medien-mittweida.de/%1/ [R,L]

是重定向的 medien-mittweida.de/的 $什么 /%20%E2%80%8E 的成的 medien-mittweida.de / $ 什么 / 的。

Is to redirect medien-mittweida.de/$anything/%20%E2%80%8E into medien-mittweida.de/$anything/.