Kristy Posted August 24, 2011 Share Posted August 24, 2011 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> 0 Quote Link to comment Share on other sites More sharing options...
jeremyhaber Posted August 24, 2011 Share Posted August 24, 2011 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 0 Quote Link to comment Share on other sites More sharing options...
Kristy Posted September 11, 2011 Author Share Posted September 11, 2011 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 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.