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

.htaccess included with XF?


Could one of the developers please explain what these lines do in the .htaccess file?

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data|js|styles|install) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]


Whenever anything is matching the condition, rewrite it - except a few dirs

It makes index.php?this/that to be just /that/<id> url pretty


XenForo Developer
Staff member
Essentially, the rules say:

If the request is something that is
- not a known file OR
- not a known link OR
- not a known directory
Then take the whole request from start to finish
Unless it's for something in the data, js, styles or install directories
And pass it to index.php