WHMCS Fully Friendly URLs not working

Hi there,

I recently switch to cyberpanel, I’m using WHMCS software, the problem is the Fully Friendly URLs inside the admin panel are not working correctly (any url inside the admin panel works), i.e:

  • domain.tld/whmcs/admin/setup (not working)

I open a thread with WHMCS Community (Fully Friendly URLs not working with openlitespeed - Troubleshooting Issues - WHMCS.Community) and request me to ask here, because other user are being using whmcs with OLS without any issue and maybe is an issue with htaccess and cyberpanel.

I have added a “context” with the following values:

URI: /clients/
Location: /home/alliance/public_html/clients
Accesible: Yes
Enable Expires: Not Set
Auto Index: Not Set
Enable Rewrite: Yes
Rewrite Inherit: Not Set
Rewrite Base:
Rewrite Rules:

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond $0#%{REQUEST_URI} ([^#])#(.)\1$
RewriteRule ^.*$ %2index.php [QSA,L]

Any ideas? to get this rules working correctly?

Went to install whmcs, a nulled version just to test.

I installed it on a folder called “teste”, which for this example is the equivalent to your “whmcs” folder.
Default with friendly URLs set up to “index.php”.

1

With “full friendly rewrite”


3

Is this what you intend to do?

Exactly, my problem is when switch from “Friendly index.php” to “Full Friendly Rewrite” the “whmcs/admin/setup” page show an 404 error

I’m using a custom “admin folder” just described here:
https://docs.whmcs.com/Customising_the_Admin_Directory


2

Like that?

The only steps I did were:
1 - Setup database for WHMCS
2 - Run the WHMCS installer
3 - Login WHMCS admin, configurations, change from friendly index.php to full friendly rewrite
4 - Run this command “service openlitespeed restart” at the vps

The last step it’s because the .htaccess may take some time to be updated (3 minutes if I recall correctly), as it runs on a cronjob. Restarting it manually makes sure that it reads the changes.
Perhaps this last step was what was happening?

I did not edit any htaccess rules inside the OLS panel so it confirms those aren’t needed.

I read your original thread at the whmcs forum, and what “WHMCS ANWAR” quoted you, was a post from 2017, at that time indeed OLS didn’t have 1:1 htaccess functionality, but now it should all work fine.

If you still have the same issue, send me a message with your anydesk so I can take a look at it.

Yes; in the meantime I changed the configuration in my installation to use the default admin directory, however the result is the same.

That’s pretty serious volunteering for community :+1:

1 Like

Hola,

Me enfrente al mismo error 404 en el la URL setup del WHMCS.

Me di cuenta que el problema proviene del archivo .htacces que protege el directorio del admin del whmcs, lo adecue o modifique para que funcione con OLS y ha vuelto a cargar las URL amigables sin problemas. Ya no muestran el error 404.

RewriteEngine On RewriteBase /admin/
# Permitir el acceso a los recursos necesarios para WHMCS
RewriteRule ^whmcs/(.*)$ - [L]

# Reglas de reescritura de URL de WHMCS
RewriteRule ^client/([^/]+)/?$ clientarea.php?rp=$1 [L,QSA]
RewriteRule ^order/?$ cart.php?a=add [L,QSA]

# Reglas de autenticación básica
AuthGroupFile /dev/null
AuthType Basic
AuthUserFile /home/xxxx/domains/xxxxt/.htpasswd/public_html/admin/.htpasswd
AuthName "whmcs"
require valid-user
ErrorDocument 401 "Unauthorized Access"

# Resto de las reglas de reescritura de WHMCS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

you may try this

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ /$1/ [R]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301]

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

i hope it helps

For me the error is the same, I have a 404 error when activating fully friendly URL in whmcs with this configuration.

Manually test it or Use browser developer tools to inspect network requests and redirects or use this tool https://Redirectchecker.com/ This can help you identify where the redirection is happening and potentially trace it back to the source.

Hello, finally solve the issue, I have renamed the .htaccess file provided by whmcs and from the whmcs admin panel generate a new .htaccess file… and its working now.

I have double check both htaccess (the renamed and the new) and both have the same configuration so I can’t tell exactly what the problem was, I want to thank everyone who took the time to help me, have a nice day!