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

stock htaccess question about friendly URL's

Discussion in 'General XenForo Discussion and Feedback' started by mrGTB, Dec 6, 2011.

  1. mrGTB

    mrGTB Well-Known Member

    I'm just curious about something to do with the stock HTACCESS file that comes with XenForo. Usually when you add fiendly URL rewrite code, most sites like askapache will tell you to add this line.

    Options +FollowSymlinks
    Is there any particular reason why XenForo doesn't use it by default?
  2. DRE

    DRE Well-Known Member

    Good question. Adding that to my htaccess

    Options +FollowSymLinks
    RewriteEngine on
    Read about it here: http://corz.org/serv/tricks/htaccess2.php

    and here too: http://gallery.menalto.com/node/32607

    I also read this: http://www.maxi-pedia.com/FollowSymLinks

    What is FollowSymLinks?

    We already mentioned that FollowSymLinks tells the web server to follow symbolic links while looking for a file, but what does it really mean?

    Symbolic links (also called symlinks or softlinks) most resemble Windows shortcuts. Websites are often set up in a way that they show pictures and other content as being physically located at some other location than they really are. Let's say you browse to some website and look at the web page source. You might see something like IMG SRC="/system/files/images/image.png" for the location of some picture that interests you. If you browse to this location in your Internet browser, it will show you the picture. But if you log into the server and go to that location /system/files/images/, you will not find it. The image.png file is not physically located in a /system/files/images/ folder, but let's say it is in a folder called /pictures.

    How does the server know that it should pull image.png from the /pictures folder when you visit the website and browse to the /system/files/images folder in your web browser? A so-called symbolic link is the guy that is responsible for this behavior. Somewhere in your system, there is a symlink that tells your server "If a visitor requests /system/files/images/image.png then show him /pictures/image.png."

    And what is the role of the FollowSymLinks setting in this?
    FollowSymLinks relates to server security. When dealing with web servers, you can't just leave things undefined. You have to tell who has access to what. The FollowSymLinks setting tells your server whether it should or should not follow symlinks. In other words, if FollowSymLinks was disabled in our case, browsing to the /system/files/images/image.png file would return depending on other settings either the 403 (access forbidden) or 404 (not found) error.
  3. Rob

    Rob Well-Known Member

    This is not required in any way. It will make not one bit of difference in xenforo's case.
  4. mrGTB

    mrGTB Well-Known Member

    Can you explain exactly why you said that? As just saying it won't make no difference tells nothing, what makes you say that? I'm aware in most web server cases it's not needed, but is used anyway as a safe guard measure just in case it is needed.
  5. CyclingTribe

    CyclingTribe Well-Known Member

    XenForo doesn't create any file system level symbolic links.
  6. Rob

    Rob Well-Known Member

    Unless you have yourself created symbolic links then you will not need the setting since xenforo (or any mods I know of) create them.

    To be totally honest, most systems with mod rewrite enabled have this options enabled by default anyway as it required by mod rewrite on most setups as far as i know.
  7. DRE

    DRE Well-Known Member

    What about other people's modifications? For example, does XFR User Albums create file system level symbolic links?
  8. CyclingTribe

    CyclingTribe Well-Known Member

    If they do, they should state as much - it's not generally a "normal" practice to create symbolic file links for web site files.

Share This Page