Jump to content

Knowledgebase Rewritebase Rule


pat_ads

Recommended Posts

Hi all, I have a subdirectory install of WHMCS (Wordpress front end) and I'm having an issue with a file constantly showing as a 404 error in my security logs, whenever someone views my WHMCS Knowledgebase. I opened a support ticket with staff, but their suggestion was too advanced for me.

 

Here's a digest of my ticket:

 

I have created some Knowledgebase articles and categories. As my clients browse these I am logging 404 errors. Below is the most recent.

 

URI:

/portal/knowledgebase/6/templates/mytemplate/wp-content/favicon1.ico

 

I have checked and favicon1.ico exists in the template directory.

 

I would appreciate any help. The favicon1.ico 404's are quite numerous and Better WP Security is locking some of these visitors out.

 

Response:

Looking at the 404 errors for favicon, it is trying to load at a location that does not actually exist (it is a rewrite). Your WP installation has many custom rewrites, and as htaccess is recursive, it is likely they are affecting your WHMCS installation.

 

Please try disabling your Wordpress .htaccess and see if this issue still occurs, if not, you may want to include a RewriteBase command for your WHMCS installation .htaccess to help prevent this.

 

Please let us know if there is anything else we can do to assist you.

 

At first I thought they meant .htaccess in root, that file is too important with all the security stuff from Wordpress. However, but I now suspect they mean the .htaccess file in my WHMCS subdirectory. That subdirectory file exists and contains:

 

RewriteEngine On

# Announcements
RewriteRule ^announcements/([0-9]+)/[a-z0-9_-]+\.html$ ./announcements.php?id=$1 [L,NC]
RewriteRule ^announcements$ ./announcements.php [L,NC]

# Downloads
RewriteRule ^downloads/([0-9]+)/([^/]*)$ ./downloads.php?action=displaycat&catid=$1 [L,NC]
RewriteRule ^downloads$ ./downloads.php [L,NC]

# Knowledgebase
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 would appreciate any tips on resolving this.

Thanks!

Link to comment
Share on other sites

Tried to do that but the knowledge base link is not actually a physical URL. Thanks. Any other suggestions out there?

i'm talking about URL of favicon in header.tpl, you need to change it from

 

"templates/mytemplate/favicon1.ico"

 

to

 

"http://yourdomain.com/templates/mytemplates/favicon1.ico"

Link to comment
Share on other sites

I think that did it! The only change was I left the 'http' off because I want the system to use either http or https, depending on where the client is on my website when he clicks the knowledgebase link.

 

The original header.tpl file reference was:

<link rel="shortcut icon" href="templates/{$template}/favicon.ico"/>

 

Changed to:

<link rel="shortcut icon" href="//mydomain.com/mywhmcsdir/templates/mytemplate/favicon.ico"/>

 

Thanks!

Edited by pat_ads
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