11-24-2007, 09:46 PM
Version 1.0 allows you to alter your URL paths to better suit the needs of your web site. Doing this requires you to edit 2 files:
/.htaccess
/includes/_global.php
Near the bottom of the includes/_global.php file you will see some variable declarations. The array of variables we want to edit here are "$domain->slugs". Let's look at an example that will turn the default "Knowledgebase" into "Questions" and "Answers." By default, your Kwikcontent refers to the URLs of these sections like this:
yourdomain.com/knowledgebase/browse/123/keywordname.html
yourdomain.com/knowledgebase/view/456/questiontitle.html
Let's make them look like this instead:
yourdomain.com/questions/123/keywordname.html
yourdomain.com/answer/456/questiontitle.html
We will need to alter the proper $domain->slug variables in the _global.php file. They currently look like this:
$domain->slugs['yahoo_qas'] = 'knowledgebase/browse/';
$domain->slugs['yahoo_qa'] = 'knowledgebase/view/';
Change them to this:
$domain->slugs['yahoo_qas'] = 'questions/';
$domain->slugs['yahoo_qa'] = 'answer/';
Note: The trailing slashes are important!
That makes the change in the PHP logic of the system. We now need to tell the server where to look for these requested URLs. To do that, we need to alter the .htaccess file. We simply need to change these two lines:
RewriteRule ^knowledgebase/browse/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/?$ yahoo_answers.php?k=$1
RewriteRule ^knowledgebase/view/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/?$ yahoo_answer.php?yqa=$1
to read like this:
RewriteRule ^questions/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/?$ yahoo_answers.php?k=$1
RewriteRule ^answer/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/?$ yahoo_answer.php?yqa=$1
Notice how we made the same types of changes in both files?
Now simply upload both files to your server and the change is made.
I wouldn't recommend doing this with a site that is already established, because search engines may still try sending traffic to the old URLs. Instead, use this technique when setting up a new domain.
Now then, since we altered the URLs, we should also alter the descriptions of those links. To do this, we just need to make another change to the $domain->titles array of variables. In these variables, the asterisk (*) will be replaced with the appropriate keyword. So let's change the following line in _global.php from this:
$domain->titles['yahoo_qas'] = '* knowledge base';
into this:
$domain->titles['yahoo_qas'] = '* questions';
Now reupload that file to your server again. You will notice that the descriptive links and headings are now altered across all areas of your site. You can replicate this for each of the areas of your site by making the same changes in those other areas. Have fun!
/.htaccess
/includes/_global.php
Near the bottom of the includes/_global.php file you will see some variable declarations. The array of variables we want to edit here are "$domain->slugs". Let's look at an example that will turn the default "Knowledgebase" into "Questions" and "Answers." By default, your Kwikcontent refers to the URLs of these sections like this:
yourdomain.com/knowledgebase/browse/123/keywordname.html
yourdomain.com/knowledgebase/view/456/questiontitle.html
Let's make them look like this instead:
yourdomain.com/questions/123/keywordname.html
yourdomain.com/answer/456/questiontitle.html
We will need to alter the proper $domain->slug variables in the _global.php file. They currently look like this:
$domain->slugs['yahoo_qas'] = 'knowledgebase/browse/';
$domain->slugs['yahoo_qa'] = 'knowledgebase/view/';
Change them to this:
$domain->slugs['yahoo_qas'] = 'questions/';
$domain->slugs['yahoo_qa'] = 'answer/';
Note: The trailing slashes are important!
That makes the change in the PHP logic of the system. We now need to tell the server where to look for these requested URLs. To do that, we need to alter the .htaccess file. We simply need to change these two lines:
RewriteRule ^knowledgebase/browse/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/?$ yahoo_answers.php?k=$1
RewriteRule ^knowledgebase/view/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/?$ yahoo_answer.php?yqa=$1
to read like this:
RewriteRule ^questions/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/?$ yahoo_answers.php?k=$1
RewriteRule ^answer/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/([_A-Za-z0-9\.\,\-\!\(\)\'\\:-]+)/?$ yahoo_answer.php?yqa=$1
Notice how we made the same types of changes in both files?
Now simply upload both files to your server and the change is made.
I wouldn't recommend doing this with a site that is already established, because search engines may still try sending traffic to the old URLs. Instead, use this technique when setting up a new domain.
Now then, since we altered the URLs, we should also alter the descriptions of those links. To do this, we just need to make another change to the $domain->titles array of variables. In these variables, the asterisk (*) will be replaced with the appropriate keyword. So let's change the following line in _global.php from this:
$domain->titles['yahoo_qas'] = '* knowledge base';
into this:
$domain->titles['yahoo_qas'] = '* questions';
Now reupload that file to your server again. You will notice that the descriptive links and headings are now altered across all areas of your site. You can replicate this for each of the areas of your site by making the same changes in those other areas. Have fun!