精华内容
下载资源
问答
  • 域名转换网址中文网址转换Moving a site from an established domain name to a new one is a nerve-wracking business: trying to ensure a seamless transition without losing any of the search engine ranking ...

    域名转换网址中文网址转换

    Moving a site from an established domain name to a new one is a nerve-wracking business: trying to ensure a seamless transition without losing any of the search engine ranking earned by the original site can feel like juggling several balls at once. Having gone through the experience myself in transitioning demosthenes.info to thenewcode.com, I thought I might offer a few pointers to help make your experience as smooth as possible.

    将站点从既定域名迁移到新域名是一件令人不安的事情:试图确保无缝过渡而又不失去原始站点所获得的任何搜索引擎排名,就像一次玩弄多个球。 我自己经历了将demosthenes.info过渡到thenewcode.com的经历 ,我想我可能会提供一些指导,以帮助您使体验尽可能的流畅。

    为什么要使用新域名? (Why A New Domain Name?)

    Before going into the details, it’s worthwhile exploring the reasons why you might want to have your site associated with a new domain name.

    在进行详细介绍之前,值得探讨一下为什么要将站点与新域名相关联的原因。

    Note that these considerations are distinct from (but may be related to) finding new hosting for your site. Switching web hosting providers without changing the domain name can be as simple as copying files and changing a few DNS settings; changing domain names is a more complex process. In some cases, you may be doing both at once.

    请注意,这些注意事项不同于(但可能与) 为您的站点找到新的托管无需更改域名即可切换虚拟主机提供商,就像复制文件和更改一些DNS设置一样简单。 更改域名是一个更为复杂的过程。 在某些情况下,您可能会同时执行两项操作。

    Broadly speaking, there are two main reasons why you might want a new domain name:

    从广义上讲,您可能想要一个新域名的主要原因有两个:

    1. The original name is no longer appropriate. The most common and persuasive reason: the company name has changed, or the purpose of the site has stretched far beyond the context of the original identity. This was the case with demosthenes.info.

      原来的名称不再合适 。 最常见且具有说服力的原因:公司名称已更改,或者网站的目的远远超出了原始身份的范围。 demosthenes.info就是这种情况。

    2. A better alternative has come along. If the only domain name you could buy at the time was shoreditchbricklayers.co.uk, but you’ve successfully purchased brickartisans.com, it may make sense to switch to the new domain name.

      出现了更好的选择 。 如果您当时唯一可以购买的域名是Shoreditchbricklayers.co.uk ,但是您已经成功购买了brickartisans.com ,那么切换到新域名可能很有意义。

    A truck strugging to carry a very large house

    注意事项 (Considerations)

    Before you switch, there are a few things to consider:

    切换之前,需要考虑以下几点:

    1. Rebranding. Changing the site domain name should be done in conjunction with, and parallel to, changes to the business: logo redesign, legal registration, even changes to the business culture. This will often produce an opportunity for completely redesigning the site (see below).

      品牌重塑 。 更改站点域名应与业务更改同时进行,并与之并行:重新设计徽标,合法注册,甚至更改业务文化。 这通常会为完全重新设计站点提供机会(请参见下文)。

    2. Timing: early is better than later Keep in mind that the longer a site has been in existence, the more external links will point to the “old” domain name. There’s nothing you can do to change this: external links will redirect to the new site if you do your job correctly, but you’ll be unable to change the text of those links if they’re on other sites. Therefore, switching to a new domain sooner rather than later is a good idea.

      时间:早于晚。请记住,网站存在的时间越长,指向“旧”域名的外部链接就越多。 您无法采取任何措施来更改此设置:如果正确执行工作,外部链接重定向到新站点,但是如果这些链接在其他站点上,则您将无法更改它们的文本。 因此, 尽快而不是稍后切换到新域是一个好主意。

    机会与必要性 (Opportunities and Necessities)

    Outside of branding, there may be a very strong argument to change the site itself. While this will extend the timeline of the transition significantly, it’s a singular opportunity to get things right. A few questions you might start asking when the possibility of changing domain names comes up:

    在品牌之外,可能有一个很强烈的理由来更改网站本身。 尽管这将大大延长过渡的时间表,但这是使事情变得正确的难得的机会。 当出现更改域名的可能性时,您可能会开始问一些问题:

    • Should the content strategy of the site be reconsidered? Sites grow organically, and often wildly: is there an opportunity to review, rewrite, and reorganise content before relaunch? Can redundant or unsuccessful pages be pruned away?

      是否应该重新考虑网站的内容策略? 网站是有机增长的,而且通常是疯狂增长的:是否有机会在重新启动之前查看,重写和重新组织内容? 是否可以删除多余或不成功的页面?

    • Can the performance of the site be improved? Due to that organic growth (and the insertion of media by owners) the size of each page may have grown considerably. Concentrating on performance will improve the experience of visitors, helping to create a successful and sustained relaunch.

      网站的性能可以提高吗? 由于这种有机增长(以及所有者插入媒体),每页的大小可能已经大大增加。 专注于表演将改善访问者的体验,有助于创建成功且持续的重新发布。

    • Was the original site responsive? If not, this transition is an excellent opportunity to make it so.

      原始网站是否响应 如果没有,那么这种过渡是实现这一目标的绝好机会。

    • Do you need to consider a new host or server setup? You may wish to reconsider the current hosting for your site: switching to a new domain name can be a good opportunity to re-evaluate the cost and effectiveness of the host, and research alternatives.

      您是否需要考虑新的主机或服务器设置? 您可能希望重新考虑站点的当前托管:切换到新域名是重新评估托管的成本和有效性以及研究替代方案的好机会。

    入职 (Onboarding)

    Photograph of moving boxes

    While the possibility of all these changes is very exciting, designers should keep one very important point in mind: many users are going to be clicking on links to the old domain name, and expect to see the site they are used to. If the site changes too radically, these returning visitors may become very confused, to the point of believing that the original site has been hijacked by a competitor.

    尽管所有这些更改的可能性都非常令人激动,但设计人员应牢记一个非常重要的观点:许多用户将单击指向域名的链接,并希望看到他们习惯的网站。 如果站点变化太大 ,这些回头客可能会感到非常困惑,以至于认为原始站点已被竞争对手劫持。

    Returning visitors must be reassured that the new site and domain name is a continuation of the old one… which is much more than presenting a tag line of “the site formerly known as” (which they may not read anyway).

    必须保证回访者相信新站点和域名是旧站点的延续……这远远超出了标有“该站点以前称为”站点的标语(他们可能始终无法阅读)的意思。

    I’d suggest that the new site incorporate several visual cues that harken back to the old design: perhaps color, or proportion, or significant site features being in the same place, to avoid confusing return visitors. These “transition elements” should remain in place for at least six months, until the vast majority of users are comfortable with the new domain and site.

    我建议新站点结合一些视觉提示,以回溯到旧设计:可能是颜色 ,比例或重要站点功能都位于同一位置,以避免使回访者感到困惑。 这些“过渡元素”应保留至少六个月,直到绝大多数用户对新域和站点感到满意为止。

    在你开始前 (Before You Start)

    In the next article I’ll look at the actual transfer process, but before you start you should ensure that four things are in place.

    在下一篇文章中,我将研究实际的传输过程,但是在开始之前,您应该确保已完成四件事。

    1. Host the new version of the site under the new domain name. Given the considerations I’ve discussed above, it’s probably easier to host the new version of the site, with it’s associated domain name, on a new server, rather than trying to “paste in place” or attempting to place the new version of the site directly on top of the old.

      在新域名下托管网站的新版本 。 考虑到我上面讨论的注意事项,将具有相关域名的网站的新版本托管在新服务器上可能要容易得多,而不是尝试“粘贴”或尝试放置新版本的网站。网站直接位于旧网站之上。

    2. Make sure that both sites are registered as properties with Google WebMaster Tools. Aligned with, but separate from, Google Analytics, Webmaster Tools allows you to see your website as Google does, including any indexing errors. Registration is as simple as uploading a text file with a unique number provided by WebMaster tools to the root of your web host. Doing this reassures Google that you actually own and are responsible for the site, and will make transitioning to the new domain much easier.

      确保两个网站都已使用Google WebMaster工具注册为属性 。 网站站长工具与Google Analytics(分析)保持一致,但又与Google Analytics(分析)分开,可让您像Google一样查看网站,包括任何索引错误。 注册就像将一个文本文件上传,该文本文件具有WebMaster工具提供的唯一编号到您的Web主机的根目录。 这样做可以确保您确实拥有Google并对该网站负责,并将使向新域的转换更加容易。

    3. Add a robots.txt file to the root of your new site. This text file will contain just two lines:

      robots.txt文件添加到新网站的根目录中 。 该文本文件将仅包含两行:

      User-agent: *
      Disallow: /

      The presence of the robots.txt file will protect the new site from being crawled early by search engines and erroneously registering the content there as a duplicate of the old domain name. Note that this doesn’t prevent the new website from being used - anyone given the URL will be able to see it - but it will prevent the site from being listed on legitimate search engines until the time is right.

      robots.txt文件的存在将保护新网站免遭搜索引擎的早期抓取,并错误地将内容注册为旧域名的副本。 请注意,这不会阻止新网站的使用-任何获得URL的人都可以看到它-但这将阻止该网站在适当的时候被列在合法搜索引擎上。

      For more thorough camouflage of the new site from the web, you could also add an .htaccess file that would only allow access with a particular username and password, and/or to visitors from a particular IP address range.

      为了从网络上更全面地伪造新站点,您还可以添加.htaccess文件 ,该文件仅允许使用特定的用户名和密码和/或来自特定IP地址范围的访问者进行访问。

    4. If needed, register the new domain with Google Analytics. It’s possible to move your Google Analytics ID from one domain to another, but my preference was to start fresh, most especially because careless coders had copied the old ID from demosthenes.info and used it on their sites, inflating my apparent number of visitors.

      如果需要,请向Google Analytics(分析)注册新域 。 可以将您的Google Analytics(分析)ID从一个域移到另一个域,但我的选择是重新开始,尤其是因为粗心的编码人员已从demosthenes.info复制了旧ID并在他们的网站上使用了它,从而增加了我的访问者数量。

    In the next article, I’ll look at the series of intricate dance steps required to successfully redirect all traffic from the old site to the new one, under its new domain name.

    在下一篇文章中,我将介绍成功地将所有流量从旧站点重定向到新站点所需要的一系列复杂的舞蹈步骤,并使用其新域名。

    翻译自: https://thenewcode.com/15/The-Big-Shift-A-Worklist-for-Transitioning-Domain-Names-Part-1

    域名转换网址中文网址转换

    展开全文
  • <div><p>类似君临.我爱你等等的中文网址,即便转码似乎也是not found</p><p>该提问来源于开源项目:Fndroid/jsbox_script</p></div>
  • 如果返回的URL中有中文可以用此方法转换 今天发现一个蛋疼的问题,服务端返回的urlString里面有时含有中文,使用 [NSURL URLWithString:urlString]生成URL对象时,iOS客户端不能正确进行网络请求,网上找到的...

    如果返回的URL中有中文可以用此方法转换

     

     今天发现一个蛋疼的问题,服务端返回的urlString里面有时含有中文,使用

    [NSURL URLWithString:urlString]生成URL对象时,iOS客户端不能正确进行网络请求,网上找到的URLEncode方法又不能完全解决问题.

       方法1:

    NSString* encodedString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];


       方法2:

    NSString * encodedString = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,(CFStringRef)urlString,NULL,NULL,kCFStringEncodingUTF8);


       这两种方法当urlString里含有中文时URL编码是正确的,但是如果其中含有已转义的%等符号时,又会再次转义而导致错误.

       

       查看方法2参数说明:

     

    CFStringRef CFURLCreateStringByAddingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, CFStringEncoding encoding);


    因此做出修改,写出方法:

        NSString *encodedString = (NSString *)

        CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,

                                                (CFStringRef)urlString,

                                                (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]",

                                                NULL,

                                                kCFStringEncodingUTF8);



    如果在所有的类里都要用到这个方法,可以写成category,然后在头文件import "NSString+URL.h" 即可调用.


    NSString+URL.h  文件

     

    1. @interface NSString (URL)  
    2. - (NSString *)URLEncodedString;  
    3. @end 

     

    NSString+URL.m  文件

     

    1. #import "NSString+URL.h"  
    2.   
    3. @implementation NSString (URL)  
    4.   
    5. - (NSString *)URLEncodedString  
    6. {  
    7.     NSString *encodedString = (NSString *)  
    8.     CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,  
    9.                                             (CFStringRef)self,  
    10.                                             (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]",  
    11.                                             NULL,  
    12.                                             kCFStringEncodingUTF8);  
    13.     return encodedString;  
    14. }  
    15. @end 

     

     

    调用方法:

     

        NSString *encodedString = [urlString URLEncodedString];

     

        //encodedString do something

     

    转载于:https://www.cnblogs.com/lidongxiao/p/5867581.html

    展开全文
  • 淘宝客短网址转换器(淘宝短网址生成器)是一款绿色免费的用于淘宝客、淘宝、天猫的网址缩短挂机。因为在很多论坛是不允许发淘宝等链接的,将链接转换后即可发到这类论坛上。 淘宝客短网址转换器使用方法 1、打开...
  • iOS 处理中文网址路径转换

    千次阅读 2017-05-20 10:24:28
    今天处理图片加载和文件下载的时候发现一个问题,服务端返回的url里面含有中文,使用[NSURL URLWithString:urlString]生成URL对象时,iOS客户端不能正确进行网络请求,网上找到的URLEncode方法又不能完全解决问题. ...

    今天处理图片加载和文件下载的时候发现一个问题,服务端返回的url里面含有中文,使用[NSURL URLWithString:urlString]生成URL对象时,iOS客户端不能正确进行网络请求,网上找到的URLEncode方法又不能完全解决问题.

       方法1:

    NSString* encodedString = [urlStringstringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];


       方法2:

    NSString * encodedString = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,(CFStringRef)urlString,NULL,NULL,kCFStringEncodingUTF8);


       这两种方法当urlString里含有中文时URL编码是正确的,但是如果其中含有已转义的%等符号时,又会再次转义而导致错误.

       

       查看方法2参数说明:

    CFStringRefCFURLCreateStringByAddingPercentEscapes(CFAllocatorRefallocator, CFStringRef originalString, CFStringRefcharactersToLeaveUnescaped, CFStringReflegalURLCharactersToBeEscaped, CFStringEncoding encoding);


    因此做出修改,写出方法:

        NSString *encodedString = (NSString *)

        CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,

                                                (CFStringRef)urlString,

                                                (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]",

                                                NULL,

                                                kCFStringEncodingUTF8);

    如果在所有的类里都要用到这个方法,可以写成category,然后在头文件import "NSString+URL.h" 即可调用.


    NSString+URL.h  文件

    [html] view plain copy
    1. @interface NSString (URL)  
    2. - (NSString *)URLEncodedString;  
    3. @end  


    NSString+URL.m  文件
    [cpp] view plain copy
    1. #import "NSString+URL.h"  
    2.   
    3. @implementation NSString (URL)  
    4.   
    5. - (NSString *)URLEncodedString  
    6. {  
    7.     NSString *encodedString = (NSString *)  
    8.     CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,  
    9.                                             (CFStringRef)self,  
    10.                                             (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]",  
    11.                                             NULL,  
    12.                                             kCFStringEncodingUTF8);  
    13.     return encodedString;  
    14. }  
    15. @end  

    调用方法:

        NSString *encodedString = [urlString URLEncodedString];

    展开全文
  • 本文实例讲述了python实现中文转换url编码的方法。分享给大家供大家参考,具体如下:今天要处理百度贴吧的东西。想要做一个关键词的list,每次需要时,直接添加 到list里面就可以了。但是添加到list里面是中文的情况...

    本文实例讲述了python实现中文转换url编码的方法。分享给大家供大家参考,具体如下:

    今天要处理百度贴吧的东西。想要做一个关键词的list,每次需要时,直接添加 到list里面就可以了。但是添加到list里面是中文的情况(比如‘丽江’),url的地址编码却是’%E4%B8%BD%E6%B1%9F’,因此需 要做一个转换。这里我们就用到了模块urllib。

    >>> import urllib

    >>> data = '丽江'

    >>> print data

    丽江

    >>> data

    'xe4xb8xbdxe6xb1x9f'

    >>> urllib.quote(data)

    '%E4%B8%BD%E6%B1%9F'

    那我们想转回去呢?

    >>> urllib.unquote('%E4%B8%BD%E6%B1%9F')

    'xe4xb8xbdxe6xb1x9f'

    >>> print urllib.unquote('%E4%B8%BD%E6%B1%9F')

    丽江

    细心的同学会发现贴吧url中出现的是%C0%F6%BD%AD,而非’%E4%B8%BD%E6%B1%9F’,其实是编码问题。百度的是gbk,其他的一般网站比如google就是utf8的。所以可以用下列语句实现。

    >>> import sys,urllib

    >>> s = '丽江'

    >>> urllib.quote(s.decode(sys.stdin.encoding).encode('gbk'))

    '%C0%F6%BD%AD'

    >>> urllib.quote(s.decode(sys.stdin.encoding).encode('utf8'))

    '%E4%B8%BD%E6%B1%9F'

    >>>

    更多关于Python相关内容感兴趣的读者可查看本站专题:《Python图片操作技巧总结》、《Python数据结构与算法教程》、《Python Socket编程技巧总结》、《Python函数使用技巧总结》、《Python字符串操作技巧汇总》、《Python入门与进阶经典教程》及《Python文件与目录操作技巧汇总》

    希望本文所述对大家Python程序设计有所帮助。

    您可能感兴趣的文章:python字符串与url编码的转换实例python实现unicode转中文及转换默认编码的方法Python编码类型转换方法详解Python批量转换文件编码格式python自然语言编码转换模块codecs介绍python轻松实现代码编码格式转换python将图片文件转换成base64编码的方法python实现批量转换文件编码(批转换编码示例)python实现文件批量编码转换及注意事项

    展开全文
  • 今天发现一个蛋疼的问题,服务端返回的urlString里面有时含有中文,使用 [NSURL URLWithString:urlString]生成URL对象时,iOS客户端不能正确进行网络请求,网上找到的URLEncode方法又不能完全解决问题.  方法1:...
  • 今天遇到一个问题,服务端返回的urlString里面有时含有中文,使用 [NSURL URLWithString:urlString]生成URL对象时,iOS客户端不能正确进行网络请求,网上找到的URLEncode方法又不能完全解决问题.  方法1: ...
  • asp.net 中文路径网址转换为utf-8

    千次阅读 2017-05-02 10:45:26
     一、转化方式: ttpUtility.UrlEncode(string,Encoding.UTF8) 二、“\"全部转化为”/",同时在C#中注意转义
  • #import @interface NSString (URLEncode) - (NSString *)URLEncode; @end ...++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...#import "NS
  • var search = decodeURI(location.search).substr(1); console.log(search); decodeURI 方法返回一个已编码的统一资源标识符 (URI) 的非编码形式。decodeURI(URIstring)必要的 URIstring 参数代表一个已编码 URI...
  • 解析器只支持 ASCII 0-127,所以当爬虫的网址中带有中文字符的时候,会报错UnicodeEncodeError: 'ascii' codec can't encode characters in position 10-14: ordinal not in range(128)报错截图解决办法所以在进行...
  • 首先找到 请求网址:   其后找到请求头: 由于是POST请求,因此需要传入 要转换的值: 返回的是整个新页面的html码,我们要从中取出需要的值。   下面附上完整代码: from urllib import request,parse ...
  • function HttpEncode(S:AnsiString):string; var  P:^Byte;  I:Cardinal; begin  Result:='';  P:=@S[1];  Result:=Format('%%%x',[Ord(P^)]);  for I := 1 to Length(S)-1 do  begin ...
  • //如果网址中有中文 或者 非法字符 需要转换 urlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //转化回去 [urlStr ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 427
精华内容 170
关键字:

中文网址转换