WHMCS URL-friendly 使用 htaccess 自定义创建的页面

WHMCS URL-friendly Custom created page with htaccess

我需要加载没有 .php 扩展名的 WHMCS custom page 但它 returns 404。 URL 友好规则在 htaccess 上设置为 default。 但它们只适用于基本页面。 最后的解决方案是在 htaccess 上设置自定义规则,以便在没有 .php 扩展名的情况下加载特定 URLs。

最终在 htaccess 上为每个自定义页面设置自定义规则,以便在没有 .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 ^(.+[^/])$  / [R]

# Send all remaining (routable paths) through index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Determine and use the actual base
RewriteCond [=10=]#%{REQUEST_URI} ([^#]*)#(.*)$
RewriteRule ^.*$ %2index.php [QSA,L]

</IfModule>