How to remove "forums" in the links with "Friendly URLs with mod_rewrite" active

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yin9
    New Member
    • Mar 2007
    • 3

    [Forum] How to remove "forums" in the links with "Friendly URLs with mod_rewrite" active

    Hi all.

    How do i to remove "forums" in the links with "Friendly URLs with Mod Rewrite" active?

    I use this .htaccess:

    RewriteEngine on
    # If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your vBulletin directory.
    # RewriteBase /forum/
    # If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.
    # Options -MultiViews
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    # Forum
    RewriteRule ^threads/.* showthread.php [QSA]
    RewriteRule ^forums/.* forumdisplay.php [QSA]
    RewriteRule ^members/.* member.php [QSA]
    RewriteRule ^blogs/.* blog.php [QSA]
    RewriteRule ^entries/.* entry.php [QSA]
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    # MVC
    RewriteRule ^(?.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
    I have installed the forum on "forums" directory, when i go to one forum o subforum, the link looks like this: www.xxxxx.com/forums/forums/forumtitle

    So i like this view: www.xxxxx.com/forums/forumtitle

    How i can do it?

    Sorry for my poor English.

    Greetings.
    Last edited by yin9; Mon 20 Dec '10, 12:52am.
  • Expert1
    Member
    • Aug 2010
    • 43
    • 4.0.x

    #2
    Well , I had this same problem with my urls. Finally i managed to remove the word "forums" from my url by choosing the advanced friendly urls in AdminCP options -> settings -> Friendly URLs .

    Now my link has the word forumdisplay.php instead of forums , i think this is much better than forums

    Comment

    • Breakpoint
      Member
      • Sep 2006
      • 43

      #3
      Can someone please help with this?

      Comment

      • Breakpoint
        Member
        • Sep 2006
        • 43

        #4
        I read this on another forum since this forum isn't too helpful, I haven't tested but looks like it could work

        Some people want the /forums/ to point to the forumindex page and /blogs/ to point to blog.php the following rewrite rules will take care of this. These should be added to the .htaccess file (don't overwrite any existing rules, these are new ones)

        Code:
        RewriteRule ^forums/(index.php)?$ forum.php?%{QUERY_STRING} RewriteRule ^blogs/(index.php)?$ blog.php?%{QUERY_STRING}
        Finally do a search of your templates + phrases for occurrences of forum.php and blog.php and change them to forums/index.php and blogs/index.php (or forums/ and blogs/) respectively.

        Comment

        • SimonVlc
          Senior Member
          • Jun 2005
          • 112

          #5
          Hi all,

          I have the same problem than the first poster. Is there any way to remove forums|threads words from the friendly urls system?

          Kind regards, Simon.

          Comment

          • Matthew Gordon
            Senior Member
            • May 2002
            • 3243
            • 1.1.x

            #6
            No, there is not.

            Comment

            • slinky
              Senior Member
              • Mar 2001
              • 3113
              • 1.1.x

              #7
              Originally posted by Matthew Gordon
              No, there is not.
              Matthew - I'm installing a new forum with the new friendly URLs. Does that mean that all forums must have the word "forums" in the URL, e.g. myforums.com/forums/11-forum-name and the like for posts?
              My law forum, lawyers and legal help site

              Comment

              • Dustin L.
                Senior Member
                • Mar 2011
                • 639
                • 4.2.X

                #8
                Originally posted by slinky
                Matthew - I'm installing a new forum with the new friendly URLs. Does that mean that all forums must have the word "forums" in the URL, e.g. myforums.com/forums/11-forum-name and the like for posts?
                Yes unless you use .htaccess to remove it from the URL.

                Best,

                Dustin
                http://quikmsg.net/strtoupper/ - Convert lowercase text and code to all uppercase!
                http://quikmsg.net/strtolower/ - Convert uppercase text and code to all lowercase!

                Comment

                • slinky
                  Senior Member
                  • Mar 2001
                  • 3113
                  • 1.1.x

                  #9
                  Originally posted by Dustin L.
                  Yes unless you use .htaccess to remove it from the URL.
                  I edited the .htaccess file but apparently there is more to it than just doing that. I get a "not found" message.

                  I did a number of things that I'm having problems with because of the internal management -

                  I have the forum in a root directory.


                  1) Getting rid of forums.php entirely from the URL
                  2) Making sure there are also no URLs being generated with forums.php (or you have 2 links to the same page)
                  3) Getting rid of the "forums/" in the friendly urls for both viewing forums and in threads.
                  4) Changing the word "threads" to something else
                  My law forum, lawyers and legal help site

                  Comment

                  • Dustin L.
                    Senior Member
                    • Mar 2011
                    • 639
                    • 4.2.X

                    #10
                    Try going to Settings -> Options -> Friendly URLs -> and setting URL Type to Mod Rewrite Friendly URLs



                    Dustin
                    http://quikmsg.net/strtoupper/ - Convert lowercase text and code to all uppercase!
                    http://quikmsg.net/strtolower/ - Convert uppercase text and code to all lowercase!

                    Comment

                    • slinky
                      Senior Member
                      • Mar 2001
                      • 3113
                      • 1.1.x

                      #11
                      Originally posted by Dustin L.
                      Try going to Settings -> Options -> Friendly URLs -> and setting URL Type to Mod Rewrite Friendly URLs



                      Dustin
                      Dustin... that's where the problem began.

                      So I have it set up that way but no matter what I do the word "forums" is always in the URL. I look at the .htaccess and removing the forums entry doesn't help me since the forums are always being generated in the URL. Even if I set the URL for the forum as the root address, I still am getting that in the URL and the home contains forums.php in the URL generated in the navigation. I removed the item in the navigation solely to use a / and that worked once - but now it's back to using the forums.php.
                      My law forum, lawyers and legal help site

                      Comment

                      • Dustin L.
                        Senior Member
                        • Mar 2011
                        • 639
                        • 4.2.X

                        #12
                        You must've edited this quickly after posting it because I didn't see it. :P Sorry about that.

                        I am no expert at Mod Rewrite, so maybe you'd get better help at vB.org.

                        Sorry :/

                        Best,

                        Dustin
                        http://quikmsg.net/strtoupper/ - Convert lowercase text and code to all uppercase!
                        http://quikmsg.net/strtolower/ - Convert uppercase text and code to all lowercase!

                        Comment

                        • slinky
                          Senior Member
                          • Mar 2001
                          • 3113
                          • 1.1.x

                          #13
                          The manual shows the threads as mysite.com/threads/thread-name but i want to change it to the letter "t" or change the articles to the letter "a" and the like. I also don't want the word "forums" in the URL but don't see any way to accomplish this.

                          - - - Updated - - -

                          Originally posted by Dustin L.
                          You must've edited this quickly after posting it because I didn't see it. :P Sorry about that.

                          I am no expert at Mod Rewrite, so maybe you'd get better help at vB.org.
                          I appreciate it. I'm just surprised that this is the way it comes out of the box.

                          - - - Updated - - -

                          The answer is - the only way is to hack the core. I just did it successfully and wrote up a tutorial for myself that I'll need to do with every upgrade. Disappointing that since 2009 this hasn't been modified but it is what it is. Thanks for trying to help - I really do appreciate it.
                          Last edited by slinky; Sat 21 Jul '12, 6:35am.
                          My law forum, lawyers and legal help site

                          Comment

                          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                          Working...