2

I have a problem with my integration of Wordpress installed in root, and Whmcs installed in the a subfolder called "client". and both has their own .htaccess file:

Wordpress (root):

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

SetEnv TZ Europe/Rome 

Whmcs (/client):

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]

And there is a settings to active url friendly in Whmcs, but when i active it it give me file not found it's like ineherite the .htaccess of the root, infact when i riname the htaccess of wordpress (installed in root) the url friendly works in the subfolder.

i try many code found here in others posts to exclude the subfolder from the root, but it doesn't works, i think it's the same problem of this guy how to ignore the .htaccess file from a parent directory but he also doesn't find the solution till now.

Thank you very much in advance for your help!

Community
  • 1
  • 1
jonnys
  • 21
  • 2

1 Answers1

0

Describe all the URLs re-writing within WordPress body

RewriteEngine On
RewriteCond %{HTTP_HOST} !^example\.com
RewriteRule (.*) http:// www.example.com/$1 [R=301,L]


RewriteRule ^([^/\.]+)/$ http:// %{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^([^/\.]+)$ index.php?rewrite=$1 [L]

or

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ index\.php\ HTTP
RewriteRule ^index\.php$ http:// www.example.com/ [R=301,L]

Two Example for re-write URLs for www and removed index.php

Sankumarsingh
  • 9,889
  • 11
  • 50
  • 74