XF 1.4 What are the non-friendly URLs in REQUEST_URI?

rugk

Active member
I want to do something in an .htaccess based on the URI of the access.
Basically this is the important line (Apache):
SetEnvIf REQUEST_URI "^/index.php?" SomeVariable

Based on SomeVariable I can later do any actions I want. (block access, send headers, etc.).

But XenForo uses friendly URLs so I only see these and don't know what URIs Apache uses "behind the scenes".
That's why I ask for the non-friendly/internal URL. E.g. for /members. I've already tried /index.php?members but this does not work.

Related: What does the default XenForo .htaccess?
 
I am not sure if Apache will have a variable for the "index.php" URL in this situation.

Try using a regex to manually identify all common XF routes.

Code:
SetEnvIf REQUEST_URI "^/(threads|posts|forums|members|attachments)/.*$" SomeVariable

It's a list of route names from XF separated by pipes. This isn't a comprehensive list, but these are the big ones.
 
Back
Top Bottom