gr8 Posted August 22, 2013 Share Posted August 22, 2013 Hello, I have a question about removing the .php extension from our WHMCS portal pages. For example http://www.exampledomain.com/whmcs/knowledgebase.php'>http://www.exampledomain.com/whmcs/knowledgebase.php becomes http://www.exampledomain.com/whmcs/knowledgebase I am considering this option because our frontend is using the latter URL structure i.e. http://www.exampledomain.com/domain-name/register etc. We consider a uniform URL structure to be good for SEO. So far we have mode_rewrite enabled on our web server and have been able to search on this forum and come across this thread which comes close but doesn't exactly solve our problem http://forum.whmcs.com/showthread.php?32310-Custom-Integration-with-SEO-Rewriting 1. Can someone help us modify this REGEX in order to strip the .php extension from URLs? RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php OR RewriteRule ^knowledgebase/([0-9]+)/([^/]*)$ ./knowledgebase.php=$1 [L,NC] RewriteRule ^knowledgebase$ ./knowledgebase [L,NC] Maybe someone can suggest a better REGEX code for me to add to .htaccess.... 2. Can someone advise on whether renaming all URLs would require me to edit hyperlinks everywhere those URLs link on the WHMCS portal (template)? A pointer in the right direction here is most welcome. I hope someone who knows .htaccess server redirects will point me in the right direction here. Thanks, Ian 0 Quote Link to comment Share on other sites More sharing options...
gr8 Posted August 31, 2013 Author Share Posted August 31, 2013 bump. Anyone to point me in the right direction? 0 Quote Link to comment Share on other sites More sharing options...
JohnnyMacD Posted September 4, 2013 Share Posted September 4, 2013 RewriteCond %{THE_REQUEST} ^GET\s.+\.php [NC] RewriteRule ^(.+)\.php$ /$1 [NE,R=301,L,NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}/$1.php -f RewriteRule ^(.*?)/?$ $1.php [L] 0 Quote Link to comment Share on other sites More sharing options...
webbymaster Posted August 25, 2023 Share Posted August 25, 2023 On 9/4/2013 at 9:53 PM, JohnnyMacD said: RewriteCond %{THE_REQUEST} ^GET\s.+\.php [NC] RewriteRule ^(.+)\.php$ /$1 [NE,R=301,L,NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}/$1.php -f RewriteRule ^(.*?)/?$ $1.php [L] In this scenario, the links in the Admin panel stop working properly (( Is there an option to do the same, but only for the site template? 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.