Replace URLs in Blogs
Run a command to replace URLs in the Blogs deployment to correct broken links.
There are cases where a collection of URLs in a Blogs deployment will break. For example, if a user changes from one deployment to another and the host name changes from lc95.cn.ibm.com to lc96.cn.ibm.com, all the URLs that use the form http://lc95.cn.ibm.com/xxx will break. Use this command to update URLs in the following places:
- Entry and comment content, including the URL for an image source, links to web pages, and video sources.
- Trackback URLs in comments.
- Links in the content of an autosaved entry or comment.
- Start the wsadmin client following the steps in Administering Blogs using the wsadmin Client.
- Start the Blogs Jython script interpreter ...
execfile("blogsAdmin.py")
- Run to fix broken URLs in entries and comments:
BlogsAdminService.fixBrokenUrls(<replacePattern>, <replaceValue>)
where <replacePattern> is the pattern of the part of the URLs that need to be replaced, and wherereplaceValue is the string to correct the URLs.
For example:
BlogsAdminService.fixBrokenUrls("http://myco.com:9082/blogs" "http://myco.com:9080/blogs")changes URLs with the form http://myco.com:9082/blogs/xxx to http://myco.com:9080/blogs/xxx.The <replacePattern> URL can contain a wildcard character (*). For example,
BlogsAdminService.fixBrokenUrls ("https://<server>/static/roller-ui/scripts/.*/ckeditor/plugins/ sametimeemoticons/images/", "https://<server>/connections/resources/ web/com.ibm.oneui.ckeditor/editor/plugins/sametimeemoticons/images/")
Results
A status message indicates the number of URLs replaced, but the number actually reflects the number of blog entries updated. For example, a blog entry containing multiple URLS counts as one update.
What to do next
Run this task twice: once for http URLs, and then again for https URLs.
Parent topic:
Administer Blogs using wsadmin.sh
Related: