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

URL Portion when creating new Forum

Discussion in 'XenForo Questions and Support' started by Ryan Kent, Feb 16, 2011.

  1. Ryan Kent

    Ryan Kent Well-Known Member

    I recognize the URL Portion is an optional field which can either rename the URL to the forum, or simply remove the id #. Can anyone offer some examples of a situation where it would be a benefit to use this option?

    I noticed it is used on the XenForo site for about half the forums: Announcements, Have You Seen, Styles, etc. I am just not clear on the value of this change.
  2. Mike

    Mike XenForo Developer Staff Member

    It's purely visual. It can make nicer looking URLs. :)
  3. Floris

    Floris Guest

  4. Ryan Kent

    Ryan Kent Well-Known Member

    Ah, nice.

    My current links are quite long, even with the URL Portion used. For example the link to my main forums is presently http://www.terapvp.com/community/index.php?forums/main-forum.2/

    I recognize using the URL Portion I can make the last part "main" rather then "main-forum.2" but the rest seems a bit long to me. Would you mind sharing how I can shorten the URL further?
  5. Brogan

    Brogan XenForo Moderator Staff Member

  6. Ryan Kent

    Ryan Kent Well-Known Member

    That worked!

    I checked the Use Full Friendly URLs option and it seems thinks look good. It seems like I am learning because, as a teacher once shared with me...."you know you are learning when an answer to one question leads you to two more". I am hoping you can enlighten me a bit further to two follow up questions this creates

    Since the friendly URLs are appearing am I to assume that mod_rewrite is available and the appropriate .htaccess file is in place?

    2. My URL now matches what I see on the XenForo forums. For example my "website" forum link is http://www.terapvp.com/community/forums/website

    The URLs Floris provided seem cleaner. I understand the reason for the URL length is because my forum software was installed in the community folder within my public_html folder. Is there a way for me to remove "community" from all my URLs without removing the folder and dumping all my files into the general public_html folder? Or is there another benefit to leaving the /community level in similiar to these XenForo forums?
  7. James

    James Well-Known Member

    There's no real benefit to leaving the community directory intact, it just contains your forum and prevents your other files getting lost within the XenForo directory. It also separates your main site from your forum, assuming you run it separately.

    As for removing the directory but containing the files in a directory (other than public_html) I'm not too sure. I've never done it before.
  8. Brogan

    Brogan XenForo Moderator Staff Member

    If it's working then your server meets the requirements.

    You can't remove it from the URL without physically relocation the files.

    Only you can decide whether ton install the forum in the root or a directory.
    It depends what your future plans are and whether you will ever have, for example, an index.php in the root, which you wouldn't be able to do if you installed the forum there.
    You can't have 2 index.php files in the same directory.
  9. Ryan Kent

    Ryan Kent Well-Known Member

    Just when I thought I had all the universe's answers on URL Portions, a new question arose....

    The URL Portion box says "Note that once specified, changing this value will cause URLs to be broken." My question is what if you don't originally provide a value in the URL Portion box, but later add one. Will that cause links to be broken?

    Example. A forum is created called XenForo - Europe. When the forum is created the URL Portion field is left blank. A month later you decide to split the forum in two: XenForo - Eastern Europe and XenForo - Western Europe. The old XenForo-Europe forums is renamed to XenForo - Eastern Europe, and a new forums is added for XenForo - Western Europe. When the change is made, you add a URL Portion of XF-East. Will this change cause any links to break?
  10. James

    James Well-Known Member

    Oracle, when adding a URL portion, you can still access it purely from the ID. The portion of the URL before the ID (if an ID is appended) is irrelevant, see below:
    http://xenforo.com/community/forums/2 (Announcements)
    http://xenforo.com/community/forums/something.2 (Announcements)
    http://xenforo.com/community/forums/announcements/ (Announcements)

    If you don't add a URL portion, you will (by default) be using link #2 above. As you can see, the forum/category name is irrelevant as long as the ID is correct.

    Hopefully this answers your question.
    Brogan and Oracle like this.
  11. Brogan

    Brogan XenForo Moderator Staff Member

    It's only the forum URL link which will change, not any posts or threads as the URLs for those do not include the forum.
    This thread for example is: http://xenforo.com/community/threads/url-portion-when-creating-new-forum.12313

    So as long as you don't have hundreds of links to the forum URL (assuming you give it a URL stub), it won't really be an issue.

    Edit: Ninja'ed by James :D
    James and Oracle like this.
  12. Ryan Kent

    Ryan Kent Well-Known Member

    I see the light! Thanks to both of you for the thorough education on this topic.
    James likes this.

Share This Page