Troubleshooting GSF Vanity URLs
So you've set up GSF Vanity URLs in your WebCenter Sites environment -- or at least you thought you did. But what should you do if vanity URLs aren't displaying in your website -- and instead you just see query string URLs everywhere? Here's a few things to check:
IS GSF FULLY INSTALLED
Go to the AdminSite site in WebCenter Sites and view the GSF WEM app. On the main page, you should see two messages like this:
If the GSF installation is incomplete, install the rest of it, or at least make sure the important vanity URL pieces are installed:
- URL Registry Component
- URL Assembler
- IPageReference component to build vanity urls
- Dispatcher Element
And if you see a message saying "Pretty URL Environment Not Identified," then just below that message it will explain how to configure this property. And third, click on the "Generate mod_rewrite rules" link in the GSF Dashboard to confirm that there's at least one Virtual Webroot for this environment.
IS YOUR ASSET WEB REFERENCEABLE
To use vanity URLs in GSF, by default your assets must be "web-referenceable." To the GSF, this means your asset's definition must contain the following attribute names (where "*" means the attribute is required):
- *h1title
- linktext
- *metatitle
- *metadescription
- *metakeyword
In addition, your asset instance should also have a valid "path" value and a template selected. The "path" URL value is valid as long as the URL begins with the URL corresponding to one of the valid Master Webroots you defined in your Virtual Webroots. If vanity URLs are still not showing up on your site, make sure your rendermode is set to "live" (vanity URLs aren't generated in "preview" rendermode), and enable TRACE for logger com.fatwire.gst.foundation.url. This should tell you exactly why a particular vanity URL wasn't generated. If a vanity URL was generated, there should be an entry in the GSTUrlRegistry table for that asset.
VANITY URLS WORK, BUT IT'S SHOWING THE WRONG ASSET
This is a common occurrence, especially early in development when there's still lots of test content around. You've gotten vanity URLs showing up on your site, but then you notice a particular URL is rendering the wrong asset. The most likely cause of this is duplicate URLs -- multiple assets with the same "path" value. If this is the case, then the GSF controller will randomly pick one of them to display. If you're wondering which one is being displayed, you can either enable DEBUG for logger "com.fatwire.gst.foundation.controller" or just add something to your layout template that displays the current asset type and id. Also, to figure out which assets have duplicate URLs, check out the GSTUrlRegistry table. I hope this helps. Happy coding!
- Log in to post comments