Mod Rewrite URL Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrsjanuary
    New Member
    • Nov 2011
    • 17
    • 4.1.x

    [Forum] Mod Rewrite URL Issue

    I know mod rewrite url's have been discussed a lot on this forum, but I'm unable to find a solution to my problem.

    The forum is installed in a subdirectory of a domain name (www.domain.com/subfolder), and I'm trying to use the Mod Rewrite URL's. I have made sure this is enabled in options, and also followed instructions I found on this forum for .htaccess, and it still doesn't work. It is adding an additional "/forums" to all URL's, which is resulting in 404 errors when you click on a link.

    I'm using the .htaccess that is in the do_not_upload folder. I have also tried a few other variations of the .htaccess rewrite rules that I have found posted in this forum, and those resulted in a server error.

    Code:
    RewriteEngine on
    
    
    # This file is only needed if you have set the Forum Component URL in your admincp and you are 
    # using the mod_rewrite option for friendly urls.  If this is the case, copy this file
    # to your forum component stub directory.
    
    
    # If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your forum component directory.
    # RewriteBase /forum-stub-directory/
    
    
    # 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} -f [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]
    Any help would be very much appreciated! Thank you
  • mrsjanuary
    New Member
    • Nov 2011
    • 17
    • 4.1.x

    #2
    bump! Anyone please?

    Comment

    • Lynne
      Former vBulletin Support
      • Oct 2004
      • 26255

      #3
      What version of vb are you using? Those aren't the rules I have in the .htaccess file that came with my 4.1.8 download.

      Please don't PM or VM me for support - I only help out in the threads.
      vBulletin Manual & vBulletin 4.0 Code Documentation (API)
      Want help modifying your vbulletin forum? Head on over to vbulletin.org
      If I post CSS and you don't know where it goes, throw it into the additional.css template.

      W3Schools <- awesome site for html/css help

      Comment

      • mrsjanuary
        New Member
        • Nov 2011
        • 17
        • 4.1.x

        #4
        I am using 4.1.8

        Comment

        • mrsjanuary
          New Member
          • Nov 2011
          • 17
          • 4.1.x

          #5
          Oops double post.

          Comment

          • Lynne
            Former vBulletin Support
            • Oct 2004
            • 26255

            #6
            You don't have any lines like these in your default .htaccess that you downloaded?

            Code:
            # MVC
            RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
            
            # Check MVC result
            RewriteCond %{REQUEST_FILENAME} -f
            RewriteRule ^(.*)$ - [NC,L]
            RewriteRule ^(.*)$ - [R=404,L]
            (or more - I have a few more lines than you do in yours.)

            Please don't PM or VM me for support - I only help out in the threads.
            vBulletin Manual & vBulletin 4.0 Code Documentation (API)
            Want help modifying your vbulletin forum? Head on over to vbulletin.org
            If I post CSS and you don't know where it goes, throw it into the additional.css template.

            W3Schools <- awesome site for html/css help

            Comment

            • mrsjanuary
              New Member
              • Nov 2011
              • 17
              • 4.1.x

              #7
              No, none of those lines are in the default .htaccess file I have. Are these rewrite rules required in order for the URL rewrite to work?

              Originally posted by Lynne
              You don't have any lines like these in your default .htaccess that you downloaded?

              Code:
              # MVC
              RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
              
              # Check MVC result
              RewriteCond %{REQUEST_FILENAME} -f
              RewriteRule ^(.*)$ - [NC,L]
              RewriteRule ^(.*)$ - [R=404,L]
              (or more - I have a few more lines than you do in yours.)

              Comment

              • Trevor Hannant
                vBulletin Support
                • Aug 2002
                • 24358
                • 5.7.X

                #8
                You're using the wrong .htaccess file - use the one that's in the main apache2 folder, not the forum folder as this is only for those using the forum in a sub-directory of the main vBulletin installation (for vB Suite).
                Vote for:

                - Admin Settable Paid Subscription Reminder Timeframe (vB6)
                - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

                Comment

                • mrsjanuary
                  New Member
                  • Nov 2011
                  • 17
                  • 4.1.x

                  #9
                  Thanks Trevor, I changed the .htaccess to the one that you said to use in the apache2 folder. However, it's still having the issue where it's adding an extra "/forums" into the URL's, which is resulting in 404 errors. Any idea how to fix this?

                  Originally posted by Trevor Hannant
                  You're using the wrong .htaccess file - use the one that's in the main apache2 folder, not the forum folder as this is only for those using the forum in a sub-directory of the main vBulletin installation (for vB Suite).

                  Comment

                  • mrsjanuary
                    New Member
                    • Nov 2011
                    • 17
                    • 4.1.x

                    #10
                    bump!

                    Comment

                    • Lynne
                      Former vBulletin Support
                      • Oct 2004
                      • 26255

                      #11
                      What is the url to your site? If you then click on forumdisplay, it will then add /forums/xxxx to the end of that url.

                      Please don't PM or VM me for support - I only help out in the threads.
                      vBulletin Manual & vBulletin 4.0 Code Documentation (API)
                      Want help modifying your vbulletin forum? Head on over to vbulletin.org
                      If I post CSS and you don't know where it goes, throw it into the additional.css template.

                      W3Schools <- awesome site for html/css help

                      Comment

                      • mrsjanuary
                        New Member
                        • Nov 2011
                        • 17
                        • 4.1.x

                        #12

                        Comment

                        • mrsjanuary
                          New Member
                          • Nov 2011
                          • 17
                          • 4.1.x

                          #13
                          I'm not sure what you mean..."forumdisplay" only shows in the URL when you use "Advanced Friendly URL's"...

                          Comment

                          • Lynne
                            Former vBulletin Support
                            • Oct 2004
                            • 26255

                            #14
                            Since you already have /forum in the url, your .htaccess says to then add /forums after that if you go to a forumdisplay.php page.

                            Please don't PM or VM me for support - I only help out in the threads.
                            vBulletin Manual & vBulletin 4.0 Code Documentation (API)
                            Want help modifying your vbulletin forum? Head on over to vbulletin.org
                            If I post CSS and you don't know where it goes, throw it into the additional.css template.

                            W3Schools <- awesome site for html/css help

                            Comment

                            • mrsjanuary
                              New Member
                              • Nov 2011
                              • 17
                              • 4.1.x

                              #15
                              Originally posted by Lynne
                              Since you already have /forum in the url, your .htaccess says to then add /forums after that if you go to a forumdisplay.php page.
                              Ohh ok I understand. So what should I change the .htaccess to so that it doesn't tell it to add "/forums" to the URLs? Do I just need to remove that line of code that refers to "/forums", or is there something else I need to do?

                              Comment

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