htaccess rewrite for custom page in root?

grantus

Active member
I have a custom page in my root and I'd like to give it a clean url. But is that possible with Xenforo?

For example, I have example.com/mypage.php and I'd like it to be example.com/mypage/ but since I have friendly URLs already with Xenforo, it seems Xenforo won't allow that, I just get an error page.

Is it possible?
 
It's probably because htaccess rules check if a file or directory exists before routing requests to index.php.

Since you are requesting /mypage/ which is a directory and does not exist, the request goes through XenForo and it shows an error because the page does not exist.

You can either:
1. Add this before all other Xenforo rules: RewriteRule ^mypage/$ /mypage.php [L,NC]
or
2. Create /mypage/ directory and move mypage.php in there as an index.php.
 
Top Bottom