[wordpress插件] Absolute-to-Relative URLs相对于绝对URL

wordpress 插件 文章 2020-01-24 16:40 551 0 全屏看文

AI助手支持GPT4.0

评分

100

100

描述

If you were to use this on a website like http;//example.com/test/testing/, you would get results like these:

如果要在 http; // example.com/test/testing / 之类的网站上使用此功能,则会得到以下结果:

        • Before: http;//example.com/test/another-test/#anchor
        • 之前:http; // example.com/test/another-test/#anchor

        • After: ../another-test/#anchor
        • 之后::../ another-test /#anchor

          • Before: http;//example.com/wp-content/themes/twentyten/style.css
          • 之前:http; // example.com/wp-content/themes/twentyten/style.css

          • After: /wp-content/themes/twentyten/style.css
          • 之后:/wp-content/themes/twentyten/style.css

            • Before: https;//example.com/wp-content/themes/twentyten/style.css
            • 之前:http s ; // example.com/wp-content/themes/twentyten/style.css

            • After: https;//example.com/wp-content/themes/twentyten/style.css
            • 之后::http s ; // example.com/wp-content/themes/twentyten/style.css

              • Before: http;//google.com/test/
              • 之前:http; // google.com/test /

              • After: //google.com/test/
              • 之后://google.com/test /

                • Before: ../../../../../../../../#anchor
                • 之前:../../../../../../../../# anchor

                • After: /#anchor
                • 之后: /#anchor

                • After ($output_type=1): ../../#anchor
                • 之后 $ output_type = 1 ../../# anchor

    All string parsing.

    所有字符串解析。

    No directory browsing.

    目录浏览。

    If you're looking for a plugin that will automatically convert all URLs on your WordPress site, instead check out my other plugin, WP-HTML-Compression.

    org / extend / plugins / wp-html-compression /“> WP-HTML-Compression

    Before you copy this code and add it into your own, keep in mind that there will probably be future updates.

    在复制此代码并将其添加到自己的代码之前,请记住,将来可能会有更新。

    Keeping the code within an installed plugin will make sure that you’re notified.

    将代码保存在已安装的插件中​​可确保您收到通知。

安装步骤

    1. Download the plugin (zip file).
    2. 下载插件(zip文件)。

    3. Upload and activate the plugin through the “Plugins” menu in the WordPress admin.
    4. 通过WordPress管理员中的“插件”菜单上载并激活插件。

下载地址

https://downloads.wordpress.org/plugin/absolute-to-relative-urls.zip

https://downloads.wordpress.org/plugin/absolute-to-relative-urls.zip

-EOF-

AI助手支持GPT4.0