URL Rewrite for HESK

Everything related to Hesk - helpdesk software

Moderator: mkoch227

Post Reply
hefin
Posts: 8
Joined: Wed Mar 24, 2010 7:44 am

URL Rewrite for HESK

Post by hefin »

I wanted to know can we add url rewrite to our HESK applications.

like a url http://hefin.in/knowaboutme should redirect to http://hefin.in/knowledgebase.php?article=2

Which makes it more Search Engine Friendly

can anyone help me with this modification.

And also please check http://hefin.in

In this site i have added my Copyright Hefin.in statement is it against the rule? please let me know.

thanks in advance

Regards
Hefin Dsouza
Regards
Hefin Dsouza
http://hefin.in
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

This is something you need to set up on your server (for example using .htaccess) and has nothing to do with HESK.

Yes, you may add your own Copyright (after all, the text in the articles is indeed yours), just the Powered by links must remain intact unless you purchase a license.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
hefin
Posts: 8
Joined: Wed Mar 24, 2010 7:44 am

Can you please help me with it

Post by hefin »

Can you help me with how do i go ahead with the url rewriting..

Even if you guide me to an article will be helpfull..
Thanks
Regards
Hefin Dsouza
http://hefin.in
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
hefin
Posts: 8
Joined: Wed Mar 24, 2010 7:44 am

Post by hefin »

I got the funda of rewriting the urls in HTACCESS file by using the

Code: Select all

RewriteRule 
what exactly i want it to work as is

When I add a new Article the url of the article should be a user friendly url like 68KB Faq does

The reason I migrated to HESK is because i got good reviews and I really like HESK only thing that is not working right is the Search Results in Google I used to get my articles listed in google when i used 68KB but now using the new HESK i dont get it.That is the reason i want to add this url rewrite funda in HESK..

I need to do something like while adding the Article I will enter the custom URI and then it should be added in the HTACCESS.

Can you help me with this please even if not complete just give me the steps ill work on it.

Thanks In advance[/url]
Regards
Hefin Dsouza
http://hefin.in
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

hefin wrote:Can you help me with this please even if not complete just give me the steps ill work on it.

Sorry, I never had to use url rewriting myself, so I can not help you here.

Greetings,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

You might be better of creating "301 - moved permanently" redirects from your old links to the new articles so Google (and other search engines) pick up the new links.

For example use htaccess to redirect
http://yoursite/old-article.php
to
http://yoursite/hesk/path-to-new-article.php

http://www.google.com/search?q=htaccess+301+redirect
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
fanta
Posts: 16
Joined: Wed Dec 16, 2009 11:00 am

Re: URL Rewrite for HESK

Post by fanta »

did you manage to find a way to rewrite hesk urls with htaccess?
hostwebservice.com
Posts: 45
Joined: Mon Dec 18, 2006 3:20 pm

Re: URL Rewrite for HESK

Post by hostwebservice.com »

Hi

Sorry for update this old thread.

I'm trying to add url rewrite to hesk.

Actual helpdesk is located in
www. hostwebservice.com/supporto

I have added this url rewrite code without success

Code: Select all

RewriteEngine On
RewriteRule ^supporto/knowledgebase/article/(.*)/(.*).html supporto/knowledgebase.php?article=$1&%{QUERY_STRING} [PT,L]
RewriteRule ^supporto/knowledgebase/category/(.*)/(.*).html supporto/knowledgebase.php?category=$1&%{QUERY_STRING} [PT,L]
Someone can help me ?

Marino
t2s
Posts: 2
Joined: Sun Dec 23, 2012 9:43 pm

Re: URL Rewrite for HESK

Post by t2s »

I made rewrite links KB articles

first add

Code: Select all

RewriteEngine On
RewriteRule ^[a-z0-9\-\_]+-([0-9]+)\.html$ knowledgebase.php?article=$1
in .htacces file

next open knowledgebase_functions.inc.php
find

Code: Select all

<td valign="top">&nbsp;<a href="knowledgebase.php?article=' . $article['id'] . '">' . $article['subject'] . '</a></td>
line 117 and 222
and replace whit

Code: Select all

<td valign="top">&nbsp;<a href="'.przyjazny_string($article['subject']).'-' . $article['id'] . '.html">' . $article['subject'] . '</a></td>
then add at end this function

Code: Select all

function przyjazny_string($tekst){
  $a = array('À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'ÿ', 'Ā', 'ā', 'Ă', 'ă', 'Ą', 'ą', 'Ć', 'ć', 'Ĉ', 'ĉ', 'Ċ', 'ċ', 'Č', 'č', 'Ď', 'ď', 'Đ', 'đ', 'Ē', 'ē', 'Ĕ', 'ĕ', 'Ė', 'ė', 'Ę', 'ę', 'Ě', 'ě', 'Ĝ', 'ĝ', 'Ğ', 'ğ', 'Ġ', 'ġ', 'Ģ', 'ģ', 'Ĥ', 'ĥ', 'Ħ', 'ħ', 'Ĩ', 'ĩ', 'Ī', 'ī', 'Ĭ', 'ĭ', 'Į', 'į', 'İ', 'ı', 'IJ', 'ij', 'Ĵ', 'ĵ', 'Ķ', 'ķ', 'Ĺ', 'ĺ', 'Ļ', 'ļ', 'Ľ', 'ľ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'Ń', 'ń', 'Ņ', 'ņ', 'Ň', 'ň', 'ʼn', 'Ō', 'ō', 'Ŏ', 'ŏ', 'Ő', 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 'O', 'o', 'O', 'o', 'O', 'o', 'OE', 'oe', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', 'S', 's', 'T', 't', 'T', 't', 'T', 't', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', 'Y', 'Z', 'z', 'Z', 'z', 'Z', 'z', 's', 'f', 'O', 'o', 'U', 'u', 'A', 'a', 'I', 'i', 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'A', 'a', 'AE', 'ae', 'O', 'o');


  return strtolower(preg_replace(array('/[^a-zA-Z0-9 -]/', '/[ -]+/', '/^-|-$/'),
  array('', '_', ''), str_replace($a, $b, $tekst)));
}
open knowledgebase.php and find

Code: Select all

<td valign="top"><a href="knowledgebase.php?article='.$article['id'].'">'.$article['subject'].'</a></td>
replace whit

Code: Select all

<td valign="top"><a href="'.przyjazny_string($article['subject']).'-' . $article['id'] . '.html">'.$article['subject'].'</a></td>
links change from /knowledgebase.php?articel=x to /topic_of_article-x.html
hostwebservice.com
Posts: 45
Joined: Mon Dec 18, 2006 3:20 pm

Re: URL Rewrite for HESK

Post by hostwebservice.com »

t2s wrote:.......
It works !!

Thanks

Marino
Post Reply