Jump to content

Recommended Posts

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

 

Link to comment
Share on other sites

  • WHMCS Technical Analyst II

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.

Link to comment
Share on other sites

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. 

 

Link to comment
Share on other sites

Welcome to the "community" @WHMCS Stephen wave-smiley.gif

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! 36chndelles.gif

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.

Link to comment
Share on other sites

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!

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