Jump to content

Using WHMCS on a Wordpress Site


Kristy

Recommended Posts

Hi All,

 

I have WHMCS installed on a site that runs on Wordpress. Currently, WHMCS and Wordpress are working well together except for one hiccup: the Knowledge Base.

 

I can access /manage/knowledgebase.php and it shows the list of articles in my KB. However, when I try to open a KB article, I get a 404 error message.

 

I suspect its due to the Wordpress HTACCESS file. But I've tried instructing HTACCESS to ignore rewriting URLs under the manage or knowledgebase folder but it doesn't work.

 

A sample KB URL is:

https://www.test.com/manage/knowledgebase/1/How-to-set-up-an-email-account-on-BlackBerry.html

 

Does anyone have any idea how to handle this?

 

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /
#Options +FollowSymlinks #WHMCS SSL

#Rewrite the URL for Wordpress, Ignore /manage
RewriteCond %{REQUEST_URI} !^/(manage/.*)$

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

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

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

</IfModule> 

Link to comment
Share on other sites

htaccess will read the commands from top to bottom when loading a location.

 

In your case wordpress is taking priority over the WHMCS rewrites. Simply reordering the htaccess file should resolve your issue.

 

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /
#Options +FollowSymlinks #WHMCS SSL

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

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


#Rewrite the URL for Wordpress, Ignore /manage
RewriteCond %{REQUEST_URI} !^/(manage/.*)$

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

 

Hope that works.

 

Edit: Also remember to change domain.com to your domain :)

Link to comment
Share on other sites

  • 3 weeks later...

Hi Jeremy,

 

Thank you for your reply. In the end, I had to switch off the use of "KB SEO Friendly URLs" as I just could not get this to work - even after re-ordering the htaccess.

 

No matter what I did, it all resulted in the KB spitting out 404 errors when attempting to open a support article.

 

Thanks :)

Kristy

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