• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

rugk

Active member
#1
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?
 

Jake Bunce

XenForo moderator
Staff member
#2
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.
 

rugk

Active member
#3
Well, I only need one dir and somehow this does not work. (with real dirs, like some examples I created it does work however...)