On a CentOS 6 running apache 2.4 and DirectAdmin, I have a wordpress website. Beside the wordpress standard architecture, I want to have some semi-static pages which are located in a sub-directory.
Filesystem is as: /home/user/public_html/sub/static1.php
Desired URL is as: https://domain/sub/static1
currently I have no problem opening the pages with .php
extension. But I want to remove it. I have tried adding some rewrite rule in .htaccess
but I have failed since the request gets redirected to homepage.
I have tried to find some solution online, including this website but nothing could help me. I assume DirectAdmin is involved in this issue.
Any help would be appreciated
2
Answers
In your
/home/user/public_html/sub/.htaccess
file, use this code:You can use Apache mod_rewrite