Nullified Posted August 16, 2012 Share Posted August 16, 2012 (edited) Default: # Knowledgebase RewriteRule ^knowledgebase/([0-9]+)/[a-z0-9_-]+/[a-z0-9_-]+\.php$ ./knowledgebase.php?action=displayarticle&id=$1 [L,NC] RewriteRule ^knowledgebase/([0-9]+)/([^/]*)$ ./knowledgebase.html?action=displaycat&catid=$1 [L,NC] RewriteRule ^knowledgebase$ ./knowledgebase.php [L,NC] I have written a custom script that acquires the article's category name and I would like to substitute that for the category id in the url. Current KB link structure: http://my.domain.com/knowledgebase/3/Shared-Web-Hosting/Dreamweaver-Site-Settings.php?article=3 I want to remove the 3 from the director structure, however to do so I must change the rewrite rule. I have tried like this: RewriteRule ^knowledgebase/[a-z0-9_-]+/[a-z0-9_-]+\.php?article=+([0-9]+)$ ./knowledgebase.php?action=displayarticle&id=$4 [L,NC] However, this does not work. Please advise. Edited August 16, 2012 by Nullified 0 Quote Link to comment Share on other sites More sharing options...
Nullified Posted August 17, 2012 Author Share Posted August 17, 2012 Task Complete with a Rewrite Condition: RewriteCond %{QUERY_STRING} (?:^|&)article=(\d+)(?:&|$) RewriteRule ^knowledgebase/[a-z0-9_-]+/[a-z0-9_-]+\.php ./knowledgebase.php?action=displayarticle&id=%1 [L,NC] 0 Quote Link to comment Share on other sites More sharing options...
theman777 Posted August 26, 2013 Share Posted August 26, 2013 Task Complete with a Rewrite Condition:RewriteCond %{QUERY_STRING} (?:^|&)article=(\d+)(?:&|$) RewriteRule ^knowledgebase/[a-z0-9_-]+/[a-z0-9_-]+\.php ./knowledgebase.php?action=displayarticle&id=%1 [L,NC] Could you publish the .htaccess, somehow i could not fix that issue with the category and the number... 0 Quote Link to comment Share on other sites More sharing options...
Nullified Posted August 26, 2013 Author Share Posted August 26, 2013 Could you publish the .htaccess, somehow i could not fix that issue with the category and the number...I did, it's in my above post. 0 Quote Link to comment Share on other sites More sharing options...
theman777 Posted August 26, 2013 Share Posted August 26, 2013 I used the same Line, but i get a error. You wrote about a custom script, that you wrote. Did you mean the .htaccess code lines, or is there anything else i need to do? 0 Quote Link to comment Share on other sites More sharing options...
pathi Posted August 29, 2013 Share Posted August 29, 2013 I did, it's in my above post. I was searching for that long time. ;-) Did you found a solution? With the .htaccess it did not work. Any help would help. Thanks a lot - - - Updated - - - I used the same Line, but i get a error. Did you found the solution? 0 Quote Link to comment Share on other sites More sharing options...
theman777 Posted August 29, 2013 Share Posted August 29, 2013 Nop, i did not find a solution. ... As i saw the knowledge Base on the Website of Nullifide, i guess he found a working solution Would be happy to fix that too. Regards 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.