简体   繁体   English

自定义URL重写,将一个CMS迁移到Wordpress

[英]Custom URL rewrite, migrate one CMS to Wordpress

I am trying to move my image gallery site from one CMS to Wordpress. 我正在尝试将图像库站点从一个CMS移至Wordpress。 On current CMS I have page with medium size image on it with URL: 在当前的CMS上,我的页面上包含带有URL的中型图片:

www.my-example-site.com/folder-one/subfolder-one/example-image-name.jpg.html www.my-example-site.com/folder-one/subfolder-one/example-image-name.jpg.html

and another page with full resolution of same image on it with URL like this: 另一个页面上具有相同图像的完整分辨率,并具有如下网址:

www.my-example-site.com/full-image/folder-one/subfolder-one/example-image-name.jpg-some-custom-keywords.html www.my-example-site.com/full-image/folder-one/subfolder-one/example-image-name.jpg-some-custom-keywords.html

I managed to make same address on test WP for medium size image, I created same categories with, and used same URL slug for categories. 我设法在测试WP上为中等大小的图像创建了相同的地址,创建了相同的类别,并对类别使用了相同的URL标记。 After that, under settings --> permalinks I made custom URL structure like: 之后,在设置->永久链接下,我创建了自定义URL结构,如下所示:

www.my-example-site.com/%category%/%postname%.jpg.html www.my-example-site.com/%category%/%postname%.jpg.html

and that made me the same urls for page with medium size image on it. 这使我在具有中等尺寸图片的页面上具有相同的网址。

But, problem is with page with full size image on it. 但是,问题是页面上有完整尺寸的图像。

Is there any way (some rewrite rule or something) to get another page to. 是否有任何方法(某些重写规则或其他方法)可将另一个页面移至该页面。 It could be 301 redirect to something like this: 可能是301重定向到以下内容:

www.my-example-site.com/folder-one/subfolder-one/example-image-name.jpg.html?-some-custom-keywords.html www.my-example-site.com/folder-one/subfolder-one/example-image-name.jpg.html?-some-custom-keywords.html

or anything similar, just to be able to use data as like on stardard page. 或类似的东西,仅仅是为了能够像在stardard页面上一样使用数据。

than I can use custom url check (on very top of single.php) to see if page contains "?-some-custom-keywords.html" to include file for generating that new page, if there is no that variable to include file for generating standard post page. 比我可以使用自定义网址检查(在single.php的最上方)查看页面是否包含“?-some-custom-keywords.html”以包含用于生成该新页面的文件,如果没有该变量包含文件用于生成标准帖子页。

Please note that there are multiple different combination for "-custom-keywords.html" suffix (about 15) 请注意,“-custom-keywords.html”后缀有多种不同的组合(大约15个)

If you have any question or suggestion please ask. 如果您有任何问题或建议,请询问。

Regards. 问候。

I'm guessing that these URL paths are stored in the database of your old CMS. 我猜想这些URL路径存储在旧CMS的数据库中。 If so, you should be changing them there to match the standard URI of WordPress instead of rigging a way for the old paths to work. 如果是这样,则应在此处更改它们以匹配WordPress的标准URI,而不是为旧路径工作提供一种方法。

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

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