Jump to content

How To: SEO Friendly Announcements links


Recommended Posts

Thanks to jasonBV in thread http://forum.whmcs.com/showthread.php?t=7886

 

I developed a way of makeing the announcements seo friendly as well as the knowledgebase links.

 

Add this to your .htaccess file

note: if you dont already have your rewrite engine "on" then add a RewriteEngine On above this line:

RewriteRule ^announcements_([0-9]+)_[a-z0-9_-]+\.html$ /announcements.php?id=$1 [L,NC]

 

Then Add this to your announcements.tpl file where your article list link is

<td class="articlelist"><a href="/announcements_{$announcement.id}_{$announcement.title|regex_replace:"/ /":"_"|regex_replace:"/[\?\'\.\,\!]/":""}.html">

 

and thats it!

 

If your having trouble finding the area in your announcements.tpl file you must replace, its on or around line 16 and looks like:

<td class="articlelist"><a href="{$smarty.server.PHP_SELF}?id={$announcement.id}">

 

Just follow this pattern to do all your other pages as well.

 

- Cheers

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated