Latest Register Log In

+ Advanced Search

Dealing with path differences: base directory vs. /admin/

Dealing with path differences: base directory vs. /admin/
By
11/04/03 (Edited 03/10/14)

When you use a relative link, like <a href="https://scripts.webmastersite.net/wsnkb/manual/">index</a>, it may not go where you expect if the template or language item is used in both the admin panel and the user side. If this is an issue (as it may be in the edit article, submit article, etc templates), make it into an absolute url like this: <a href="{DIRURL}/index.php">index</a>. {DIRURL} stands in for your site's base url. To link to the admin directory's index, use <a href="{DIRURL}/{ADMINDIR}/index.php">index</a>.

This can also be important for URL rewriting, when you have pseudo-subdirectories you may be in, though WSN will normally auto-absolutize your links when rewriting is on.




Description Effectively write your templates to look the same whether viewed from your base directory or from the admin directory.
Rating
Views 2042 views. Averaging 0 views per day.