Lite Forum Support
  • Home
  • Login
  • Register
  1. Home
  2. Feature Requests & Ideas
  3. Descriptive URL's

Descriptive URL's

Avatar
Darbdenral
Dec 08, 2025
10:00
<p>I'd like to see the <strong>category</strong> and <strong>post</strong> URL's expanded to use the title of the category and post titles, etc.</p><h2 style="color: rgb(204, 204, 204); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Current URL Structure</h2><pre style="overflow-x: auto; max-width: 100%; white-space: pre; padding: 8px; border-radius: 4px; margin: 8px 0px; box-sizing: border-box; color: rgb(204, 204, 204); font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; font-size: 14px; word-break: break-word;">/topic/1 /topic/123 </code></pre><h2 style="color: rgb(204, 204, 204); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Proposed SEO-Friendly Structure</h2><pre style="overflow-x: auto; max-width: 100%; white-space: pre; padding: 8px; border-radius: 4px; margin: 8px 0px; box-sizing: border-box; color: rgb(204, 204, 204); font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; font-size: 14px; word-break: break-word;">/topic/1/welcome-to-liteforum /topic/123/how-to-install-on-windows </code></pre><p style="display: inline; color: rgb(204, 204, 204); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong>Benefits:</strong></p><p><br></p><ol style="padding-inline-start: 1.5em; color: rgb(204, 204, 204); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><li><strong>Better SEO</strong><span>&nbsp;</span>- Search engines favor descriptive URLs</li><li><strong>User-friendly</strong><span>&nbsp;</span>- Users can see topic content from URL</li><li><strong>Shareable</strong><span>&nbsp;</span>- More descriptive when sharing links</li><li><strong>Professional</strong><span>&nbsp;</span>- Looks more polished</li></ol><p style="display: inline; color: rgb(204, 204, 204); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong>Implementation would be simple:</strong></p><p><br></p><ol style="padding-inline-start: 1.5em; color: rgb(204, 204, 204); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><li><p style="display: inline;"><strong>Generate slug from topic title:</strong></p><pre style="overflow-x: auto; max-width: 100%; white-space: pre; padding: 8px; border-radius: 4px; margin: 8px 0px; box-sizing: border-box;"><code class="language-php" style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; font-size: 14px; word-break: break-word;">function createSlug($title) { $slug = strtolower(trim($title)); $slug = preg_replace('/[^a-z0-9-]/', '-', $slug); $slug = preg_replace('/-+/', '-', $slug); return trim($slug, '-'); } </code></pre></li><li><p style="display: inline;"><strong>Update URL helper:</strong></p><pre style="overflow-x: auto; max-width: 100%; white-space: pre; padding: 8px; border-radius: 4px; margin: 8px 0px; box-sizing: border-box;"><code class="language-php" style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; font-size: 14px; word-break: break-word;">public static function topic($id, $title = '', $page = 1) { $slug = $title ? '/' . createSlug($title) : ''; if (self::isRewriteEnabled()) { $url = self::buildPath("/topic/$id$slug"); return ($page &gt; 1) ? $url . "?p=$page" : $url; } // Query string stays the same (slug optional) $url = self::buildPath("/index.php?page=topic&amp;id=$id"); return ($page &gt; 1) ? $url . "&amp;p=$page" : $url; } </code></pre></li><li><p style="display: inline;"><strong>Router ignores slug, uses only ID:</strong></p><pre style="overflow-x: auto; max-width: 100%; white-space: pre; padding: 8px; border-radius: 4px; margin: 8px 0px; box-sizing: border-box;"><code class="language-php" style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; font-size: 14px; word-break: break-word;">// .htaccess or router // /topic/123/any-slug-here -&gt; uses only 12</code></pre></li></ol><p style="display: inline; color: rgb(204, 204, 204); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong>Backward compatible</strong><span>&nbsp;</span>- Old URLs<span>&nbsp;</span><code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; font-size: 14px; word-break: break-word;">/topic/123</code><span>&nbsp;</span>still work, slug is optional and ignored by router (only ID matters).</p><p><span style="color: rgb(204, 204, 204); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"><span>&nbsp;</span></span><br></p><br><p><br></p>
1 0
Please login to reply. login.

© 2025 Lite Forum Support. All rights reserved.