ExSite Webware Discussions > Comment "Intra-CMS Links"
by Sarmad, posted on 11:41 AM, August 17, 2007
| Hello All,
This is my first post on this forum I was wondering why CMS uses full URLs in internal links (internal to CMS) on published pages. Isn't there a way to make CMS use relative links in the published pages? Relative links are more useful for search engine optimization purposes. Regards, Sarmad |
by Morgan Burke, posted on 1:03 PM, August 21, 2007
| Sarmad,
This turns out to be a very tricky problem. Pages can have both static and dynamic representations, and dynamic pages can also be prepublished as static pages, and post-processed to insert dynamic content. A particular page can be accessible in all of these modes at once. For instance, a static page could regenerate itself due to a recursive link in a plug-in, resulting in a dynamic page, but this dynamic page could be built from a prepublished static version of the page. The URL path to the page differs in each case. For instance, each of these URLs might point to the same page: /index.html /cgi/page.cgi/index.html /cgi/page.cgi?_id=1 Other cases may also be possible in a mod_rewrite scenario. Since the path varies in each case, using a relative URL might inadvertently invoke the target page in the wrong mode. For example, if the current URL is of the 3rd form, then a relative link to "foo.html" will go to /cgi/foo.html which is clearly wrong. So in that case we *must* use complete paths to ensure we can switch context between the HTdocs and CGI folders correctly. As a general rule, it is easier to use complete paths everywhere than to figure out both the current mode and the target mode, and based on that info take a guess how relative the link can be. Because of mod_rewrite, it can only ever be a guess, since some of the URL handling is outside our scope. |
by Morgan Burke, posted on 6:23 PM, September 24, 2007
| For ExSite 3.5.2, there will be some extra configuration settings to control relative and full URLs on pages.
Defaults (to match v3.5.1 behaviour) are: page.relative_static_url = 0 page.relative_dynamic_url = 1 These can be altered to force different default behaviour. Note that in this case "relative" only means that the hostname is excluded from the URL; the full path from the root is given. "http://mydomain.com/section/file.html" is an example of a full URL; "/section/file.html" would be the corresponding relative URL. The system does not yet support the completely relative "file.html", for reasons noted above. |
| back |