Jump to content

SEO friendly knowledgebase links


jasonBV

Recommended Posts

  • Replies 93
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

After many changes i got this working as i wish....but now im concerned about duplicated content at google, sing this a page that is passing the variables continue available.

 

I mean, the urls are friendly now but if you use the old (default) format it also working this could end up as a duplicated content at google, wondering if someone tweaked so the default url format/article is redirected to the new url format article using 301?

 

Thanx!

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

It took me awhile to get through all the different options as I was getting the 404 errors and once I got that correct I was receiving the css issues etc...

 

To fix the 404 errors I simply removed the / before the path in the .htaccess file as my install is not in the root path to fix the css issues I tried all the options provided and to conclude the above if statement worked great and so did the changing to - instead of / ... so basically the codes I am utilizing currently are without changing the header.tpl and utilizing the - instead of / as this was what I chose... I just wanted to post the complete codes I am utilizing so that if anyone else is running into the same issues they can simply copy them instead of going through all the different options etc...

 

Here is my .htaccess

 

RewriteEngine On
RewriteRule ^knowledgebase-([0-9]+)-([0-9]+)-[a-z0-9_-]+\.html$ knowledgebase.php?action=displayarticle&catid=$1&id=$2 [L,NC]
RewriteRule ^knowledgebase-([0-9]+)-([^/]*)$ knowledgebase.php?action=displaycat&catid=$1 [L,NC]

 

The code Below will replace everything between the first instance of <strong> and </strong> in both files knowledgebase.tpl & knowledgebasecat.tpl

 

<a class="menu" href="knowledgebase-{$kbcat.id}-{$kbcat.name|regex_replace:"/ /":"-"|regex_replace:"/[\?\'\.\,\!]/":""}">
<img src="images/folder.gif" border="0" align="middle" alt="" /> {$kbcat.name}</a>

 

The code Below will replace everything between the SECOND instance of <strong> and </strong> in both files knowledgebase.tpl & knowledgebasecat.tpl

 

<a href="knowledgebase-{$kbarticle.category}-{$kbarticle.id}-{$kbarticle.title|regex_replace:"/ /":"-"|regex_replace:"/[\?\'\.\,\!]/":""}.html">{$kbarticle.title}</a>

 

Thank you jasonBV for the great code, and thank you everyone else for helping get this functioning for the rest of us as well...

Link to comment
Share on other sites

  • 3 weeks later...

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