1. 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?

Discussion in 'XenForo Questions and Support' started by rugk, Jun 14, 2015.

  1. rugk

    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):
    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?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.

    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.
  3. rugk

    rugk Active Member

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

Share This Page