WHMCS url友好自定义创建的网页与htaccess



我需要加载没有.php扩展名的WHMCS自定义页面,但它返回404。URL友好规则默认设置在htaccess上。但它们只适用于基本页面。最后一个解决方案是在htaccess上设置自定义规则,以便加载不带.php扩展名的特定url。

最终在每个自定义页面上设置自定义规则,以便在没有。php扩展名的情况下加载。

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
#rempove .php for custom pages on by one
RewriteRule ^customPageOne$ customPageOne.php [L]
RewriteRule ^customPageTwo$ customPageTwo.php [L]
RewriteRule ^customPageThree$ customPageThree.php [L]
# Redirect directories to an address with slash
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$  $1/ [R]
# Send all remaining (routable paths) through index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Determine and use the actual base
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)1$
RewriteRule ^.*$ %2index.php [QSA,L]
</IfModule>