Search the Community
Showing results for tags '.htaccess'.
-
How do I control the routePath output? I'm trying to customize the permalink so it spits out {$kbarticle.categoryname} instead of {$kbarticle.categoryid} domain.com/knowledgebase/{$kbarticle.categoryid}/{$kbarticle.title} (currently) domain.com/knowledgebase/{$kbarticle.categoryname }/{$kbarticle.title} (what would be nice) Using WHMCS 7.4.1 with default template, I notice on the knowledgebasecat.tpl page <a href="{routePath('knowledgebase-category-view',{$kbcat.id},{$kbcat.urlfriendlyname})}"> but when I use "find in file" search in Sublime nothing is found. Might you have any wisdom to share, perhaps a hook replacement or even smarty replace? https://www.smarty.net/docsv2/en/language.modifier.replace.tpl https://whmcs.community/topic/259281-htaccess-rewrite-knowledgebase-to-xyz-and-trim-redirect-extension-php-or-html-w-trailing-slash/
-
May you please offer wisdom to help me achieve my desired URL for knowledgebase? rename knowledgebase to kb rearrange, so {$kbarticle.urlfriendlytitle} appears before {$kbarticle.id} hide / remove / trim and or redirect extensions *trailing slash *force lowercase * = extra fancy, but still, highly desirable original / stock http://domain.com/knowledgebase/1/Test.html new (what I currently have with code below) http://domain.com/kb/Test-1.html * rearrange and rename knowledge to kb desire http://domain.com/kb/test-1 *force lowercase, remove extension and rearrange and rename Here is my current code .htaccess: RewriteRule ^kb/[a-z0-9_-]+\-([0-9]+).html$ ./knowledgebase.php?action=displayarticle&id=$1 [L,NC] RewriteRule ^knowledgebase/([0-9]+)/([^/]*)$ ./knowledgebase.php?action=displaycat&catid=$1 [L,NC] RewriteRule ^knowledgebase$ ./knowledgebase.php [L,NC] Here is the original stock .htaccess on fresh WHMCS install: RewriteRule ^knowledgebase/([0-9]+)/[a-z0-9_-]+\.html$ ./knowledgebase.php?action=displayarticle&id=$1 [L,NC] RewriteRule ^knowledgebase/([0-9]+)/([^/]*)$ ./knowledgebase.php?action=displaycat&catid=$1 [L,NC] RewriteRule ^knowledgebase$ ./knowledgebase.php [L,NC] I've already fired up some template files, like these: knowledgebasecat.tpl knowledgebasearticle.tpl knowledgebase.tpl After I launched up the file, I didn't have to customize that much, and I just cut / paste some code, for example: stock code line #34 <a href="{if $seofriendlyurls}{$WEB_ROOT}/[u]knowledgebase/{$kbcat.id}/{$kbcat.urlfriendlyname}[/u]{else}knowledgebase.php?action=displaycat&catid={$kbcat.id}{/if}"> new code <a href="{if $seofriendlyurls}{$WEB_ROOT}/[u]kb/{$kbcat.urlfriendlyname}-{$kbcat.id}[/u]{else}knowledgebase.php?action=displaycat&catid={$kbcat.id}{/if}"> --- sources that helped me out, but didn't get me 100% desired results: #1 = http://stackoverflow.com/questions/9608366/remove-index-php-from-url-with-htaccess/9619319?noredirect=1#comment64671812_9619319 #2 = https://alexcican.com/post/how-to-remove-php-html-htm-extensions-with-htaccess/
-
- .htaccess
- force lowercase
-
(and 3 more)
Tagged with:
-
Hi All, Anyone mind sharing what you've added to your .htaccess file for better security? Besides what's suggested from WHMCS docs regarding "restrict admin area access by IP" - What else do you advise adding to your .htaccess file? Also should each template folder have a .htaccess file, and if so what should be included? Thanks!
-
I'm trying to get a community addon to work. It's NHP CMS Plus. It doesn't come with any documentation or anything. I contacted the person who created it via support ticket(Lee Mason and No Half Pixels) and support has been ultra slow. Anyway, he says the contents of the htaccess.txt in the addon must be added to the root .htaccess. It's contents are: <IfModule mod_rewrite.c> RewriteEngine On Options +FollowSymlinks RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . modules/addons/whmcs_cms_plus/seourls.php [L,QSA] </IfModule> Still, it doesn't work. I removed everything in my root .htaccess except that snippet of code and I still get "ERR_TOO_MANY_REDIRECTS" in Chrome and "The page isn't redirecting properly" in Firefox when I use the addon. Anyone here have any ideas why it isn't working, or possible conflicts in WHMCS, or server misconfiguration that could be causing the problem? I'm positive mod_rewrite is enabled. Thanks.
