Tom Wilson Posted May 19, 2019 Share Posted May 19, 2019 Hey I've used the below multiple times on other sites and it works, but on WHMCS it does not, any advise on how to remove .php? So you can just navigate to /hosting instead of /hosting.php? RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^([^\.]+)/$ $1.php RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^([^\.]+)/$ $1.html 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Technical Analyst II WHMCS Stephen Posted May 19, 2019 WHMCS Technical Analyst II Share Posted May 19, 2019 Hello @Tom Wilson WHMCS does not currently support removing the .php extension from files. We have however introduced friendly URLs to more and more areas of the product. As outlined by my colleague John on our Feature Request Board We introduced a new Friendly URLs feature which brings the potential for more human-readable URLs to different parts of the system. You can see an example of this in the MarketConnect landing pages, eg: /store/email-services. Unfortunately I cannot provide an ETA on this and any announcements such as this will be made on our Blog or in the WHMCS Changelogs Regards, Stephen. 0 Quote Link to comment Share on other sites More sharing options...
Tom Wilson Posted May 20, 2019 Author Share Posted May 20, 2019 11 hours ago, WHMCS Stephen said: Hello @Tom Wilson WHMCS does not currently support removing the .php extension from files. We have however introduced friendly URLs to more and more areas of the product. As outlined by my colleague John on our Feature Request Board We introduced a new Friendly URLs feature which brings the potential for more human-readable URLs to different parts of the system. You can see an example of this in the MarketConnect landing pages, eg: /store/email-services. Unfortunately I cannot provide an ETA on this and any announcements such as this will be made on our Blog or in the WHMCS Changelogs Regards, Stephen. Hi Stephen it would be great if this is pushed out quicker, it just seems messy to tell customers “for more information visit www.example.com/about.php” - just to say about without the extension is a lot more corporate and friendly. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 20, 2019 Share Posted May 20, 2019 Welcome to the "community" @WHMCS Stephen 16 hours ago, WHMCS Stephen said: As outlined by my colleague John on our Feature Request Board that link's pointing back to this current thread... i'm getting dizzy following the loop! 19 hours ago, Tom Wilson said: I've used the below multiple times on other sites and it works, but on WHMCS it does not, any advise on how to remove .php? So you can just navigate to /hosting instead of /hosting.php? as Stephen says, Friendly URLs is the stumbling block here... I disliked answering htaccess questions before FU, but now with the feature increasingly enabled on both the admin & clients sides, I wouldn't bother trying to answer them.... it'd be like walking into a minefield without a map. one slightly awkward workaround example, and possibly not ideal for you as it would redirect /about to about.php (and so still show the .php in the filename) would be to add a little bit of Smarty/JS to the beginning of the error/page-not-found.tpl template... {if $currentpagelinkback|strstr:"/about"} <script>window.location.href = "{$systemsslurl}about.php";</script> {elseif $currentpagelinkback|strstr:"/brian"} <script>window.location.href = "{$systemsslurl}brian.php";</script> {/if} so if you type in domain.com/whmcs/about/ it should redirect the user to domain.com/whmcs/about.php - if it works in your install (it works locally for me with minimal testing), then you could expand it with additional elseif's for other files - I wouldn't suggest trying to do this with any core WHMCS php file (e.g index, cart, clientarea etc), but it should safely work for any custom files that you've added to your install. also, the opening slash in the strstr code above is probably essential to avoid infinite redirection loops occurring if directory and redirected filename would both match... 6 hours ago, Tom Wilson said: it would be great if this is pushed out quicker, it just seems messy to tell customers “for more information visit www.example.com/about.php” - just to say about without the extension is a lot more corporate and friendly. i'd use this solution with caution... I think it will work if used correctly, but I haven't tested it thoroughly under all conditions. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Technical Analyst II WHMCS Stephen Posted May 20, 2019 WHMCS Technical Analyst II Share Posted May 20, 2019 @Tom Wilson & @brian! Link updated for coherence and sanity ! 😉 As follows - https://requests.whmcs.com/topic/products-links-seo-friendly-urls 0 Quote Link to comment Share on other sites More sharing options...
Tom Wilson Posted May 20, 2019 Author Share Posted May 20, 2019 3 hours ago, brian! said: one slightly awkward workaround example, and possibly not ideal for you as it would redirect /about to about.php (and so still show the .php in the filename) would be to add a little bit of Smarty/JS to the beginning of the error/page-not-found.tpl template... {if $currentpagelinkback|strstr:"/about"} <script>window.location.href = "{$systemsslurl}about.php";</script> {elseif $currentpagelinkback|strstr:"/brian"} <script>window.location.href = "{$systemsslurl}brian.php";</script> {/if} It's award indeed, but it does the job! I'm going to use this. Thanks! 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.