Title: Relative URLs
Author: Guglielmo Pepe
Published: <strong>2021 年 5 月 9 日</strong>
Last modified: 2021 年 5 月 9 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/wp-relative-url.svg)

# Relative URLs

 作者：[Guglielmo Pepe](https://profiles.wordpress.org/gpepe/)

[下载](https://downloads.wordpress.org/plugin/wp-relative-url.1.0.0.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-relative-url/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-relative-url/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/wp-relative-url/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/wp-relative-url/#developers)

 [支持](https://wordpress.org/support/plugin/wp-relative-url/)

## 描述

_By default, WordPress saves the content with local domain. If you want develop 
your blog in one domain and go live in another, you need replace all URLs in the
database._

Relative URLs replace all absolute URLs with relative URLs quickly. You can move
from localhost to live domain with minimal effort, but this plugin never change 
links in database, so you can develop in stanging area or in a subdomain o in a 
sub-directory without worrying to replace URLs in the content.

**Notice: This plugin SHOULD be used for local development only.**
 **Notice: This
plugin may conflict with server based cache services (like nginx or Varnish).**

#### Benefits

 * Go live in one domain, develop in another
 * Move from one directory to another with minimal effort
 * Never change links in database
 * Switch between HTTP and HTTPS sites
 * Backup a production site from one domain, restore for testing at another domain

### Features

 * Removes the domain name on links for internal links
 * Removes the domain name from on image sources for images located in the server
 * Dont’t replace URLs in database

## 安装

 1. Upload the plugin files to the `/wp-content/plugins/wp-relative-url` directory,
    or install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress

## 常见问题

### Why do I need this?

With Relative URLs you don’t need to adjust links after change domain. When you 
change domains and you move your WordPress blog from subdomain to parent domain,
you need to change base URL in configuration and you need to replace all URLs in
database.
 If you activate Relative URLs all URLs are fine after transfer site: 
you don’t need to change base URL and you don’t need to replace all URLs in database.

### I need to change something after change domain?

No. The plugin replace URLs before WordPress send output, so you don’t need any 
configuration after activate.

### How it works?

Relative URLs replace the absolute URL with relative URL before WordPress send output.
That’s it.

### Can I request new feature?

Of course! I love to get your ideas! Please, [submit your idea](https://wordpress.org/support/plugin/wp-relative-url/)
here.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Relative URLs」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Guglielmo Pepe ](https://profiles.wordpress.org/gpepe/)

[帮助将「Relative URLs」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-relative-url)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-relative-url/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/wp-relative-url/)，或通过[RSS](https://plugins.trac.wordpress.org/log/wp-relative-url/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-relative-url/)。

## 更新日志

#### 1.0.0

 * First release of Relative URLs

## 额外信息

 *  版本 **1.0.0**
 *  最后更新：**6 年前**
 *  活跃安装数量 **20+**
 *  WordPress 版本 ** 5.2.3 或更高版本 **
 *  已测试的最高版本为 **5.7.21**
 *  PHP 版本 ** 7.2 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-relative-url/)
 * 标签
 * [https](https://cn.wordpress.org/plugins/tags/https/)[relative link](https://cn.wordpress.org/plugins/tags/relative-link/)
   [seo](https://cn.wordpress.org/plugins/tags/seo/)[staging](https://cn.wordpress.org/plugins/tags/staging/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-relative-url/advanced/)

## 评级

尚未提交反馈。

[您的评价](https://wordpress.org/support/plugin/wp-relative-url/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-relative-url/reviews/)

## 贡献者

 *   [ Guglielmo Pepe ](https://profiles.wordpress.org/gpepe/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-relative-url/)