Jump to content

knowledgebase breaks site rewrites


PDS

Recommended Posts

My WHMCS is in a directory named support. I have the following in my public_html htaccess and the site is working without errors, everything is as expected:

 

Options +FollowSymlinks
RewriteEngine On
RewriteBase /

#Not show php ext
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

#Change to the preferred domain
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

#Rewrite the URL for WHMCS to always use https except for the whmcs/dl.php file
RewriteCond %{REQUEST_URI} !^/support/dl.php [NC]
RewriteCond %{REQUEST_URI} ^/support/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]

#Rewrite the URL for WHMCS dl area to always use http
RewriteCond %{REQUEST_URI} ^/support/dl.php [NC]
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

 

When I enable the below support directory htaccess to use KB it works but all rewrites fail, i.e I can use domain with WWW and navigate WHMCS using http and the WHMCS branding appears on the page.

 

# Knowledgebase
RewriteRule ^knowledgebase/([0-9]+)/[a-z0-9_-]+\.php$ 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 asked support but they don't appear to know why. I've tried commenting out RewriteBase / and Options +FollowSymlinks but still same problem. SEF is ticked to use in admin

 

The server error log is:

 

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: https://domain.com/support/knowledgebase.php

 

Which is an htaccess loop caused by adding the KB rule

 

Can anyone help me resolve this please?

Link to comment
Share on other sites

Fixed having spent days on this.

 

The instructions I read said WHMCS rewrites have to be in web root. I've added them to the WHMCS subdirectory htaccess with knowledgebase, announcements and downloads directives and amended path. Works flawlessly now.

Link to comment
Share on other sites

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