Replacing URLs in Blogs
Run a command to replace URLs in your Blogs deployment to correct broken links.
Before you begin
To edit configuration files, you must use the wsadmin client. See Starting the wsadmin client for details.
About this task
- 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.
Procedure
- Start the wsadmin client following the steps in Administering Blogs using the wsadmin Client.
- Start the Blogs Jython script interpreter by entering the
following command:
execfile("blogsAdmin.py")
- Run the following command to fix broken URLs in entries
and comments:
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.BlogsAdminService.fixBrokenUrls(<replacePattern>, <replaceValue>)
For example:
changes URLs with the form http://example.com:9082/blogs/xxx to http://example.com:9080/blogs/xxx.BlogsAdminService.fixBrokenUrls("http://example.com:9082/blogs" "http://example.com:9080/blogs")
Note: 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/")