简体   繁体   English

替换Typo3 DB中的URL

[英]Replace URLs in Typo3 DB

So I have a Site created with Typo3. 所以我有一个用Typo3创建的网站。 I also have a domain which is linked to the folder of the Typo3 Installation. 我还有一个链接到Typo3安装文件夹的域。 www.example.org www.example.org

I created a Subdomain and linked it to the same folder and used the Main Domain for something else. 我创建了一个子域,并将其链接到相同的文件夹,并将主域用于其他内容。

But now everything on the Subdomain still has the URL Structure of the main site so when I open up sub.example.org all the Links and Images still have the URL from www.example.org/... 但是现在,子域上的所有内容仍然具有主站点的URL结构,因此当我打开sub.example.org时,所有链接和图像仍然具有来自www.example.org/的URL。

I exported the Database and replaced every URL with notepad++ and imported it again. 我导出了数据库,并用notepad ++替换了每个URL,然后再次将其导入。 But that didnt change anything. 但这并没有改变任何东西。 What do I do wrong? 我做错了什么?

There are two (three with realurl) places where you need to look if changing the domain of a TYPO3 site, if everything is done by the book and noone hardcoded the domain all over the place or something. 如果更改是TYPO3站点的域,则需要在两个位置(带有realurl的三个位置)查找,如果这一切都是由本书完成的,并且没人在整个位置或任何地方对域进行硬编码。

Usually you do not need to work in the database directly. 通常,您不需要直接在数据库中工作。

After doing the changes, make sure to clear the caches (install tool in 6.2+, "all caches" in earlier versions). 进行更改后,请确保清除缓存(6.2+中的安装工具,早期版本中的“所有缓存”)。

First : 首先
There are two TypoScript settings that influence the generated URL: config.baseURL and config.absRefPrefix . 有两个TypoScript设置会影响生成的URL: config.baseURLconfig.absRefPrefix

The recommended way to use those is to not set config.baseURL (would result in a <base> tag in the HTML <head> ), and set config.absRefPrefix to the subpath where TYPO3 is, relative to the document root. 推荐的使用方式是不设置config.baseURL (在HTML <head>导致<base>标记),并且将config.absRefPrefix设置为相对于文档根目录TYPO3所在的子路径。 If TYPO3 lies directly in the document root, set it to / . 如果TYPO3直接位于文档根目录中,请将其设置为/

Second : 第二
In the database, there are "Domain Records". 在数据库中,有“域记录”。 They are usually located on the root page of a site. 它们通常位于网站的根页面上。 Change those to the new domain. 将其更改为新域。

Third (with realurl only): 第三 (仅使用realurl):
Check the realurl configuration file, usually located in typo3conf/realurl_conf.php . 检查realurl配置文件,通常位于typo3conf/realurl_conf.php Depending on your setup, the old domain name is used there and needs to be changed. 根据您的设置,旧域名在那里使用并且需要更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM