Apache redirection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • user918
    Member
    • May 2017
    • 58
    • 5.3.x

    Apache redirection

    Hi,

    have the following Prblem, set up a /var/www/test_seite_de/forum533/.htaccess forwarding.
    From http://test.die_seite.de/forum533/ on http://test.die_seite.de/forum533/node/14

    In the file .htaccess, I have section

    Code:
    <IfModules mod_rewrite. c>
    and before php_flag display_errors off tries the following:

    Code:
    RewriteRule ^forumum533/)$ http://test.die_seite.de/forum533/node/14=$1[L, QSA] # does not work.
    RewriteRule ^forumum533/)$ http://test.die_seite.de/forum533/node/14            # does not work.
    after that.

    Does anyone have an idea how to set up the forwarding?

    vb 5.3.3.
  • Mark.B
    vBulletin Support
    • Feb 2004
    • 24286
    • 6.0.X

    #2
    I'm not certain this will work. vB5 works entirely using rewrite rules, trying to put a custom one on top of those is likely to cause problems.
    It's certainly not an officially supported configuration.
    MARK.B
    vBulletin Support
    ------------
    My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
    My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

    Comment

    • Wayne Luke
      vBulletin Technical Support Lead
      • Aug 2000
      • 73976

      #3
      Without seeing your entire .htaccess file, we can't even begin to determine why these rewrites do not work.
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud demonstration site.
      vBulletin 5 API

      Comment

      • user918
        Member
        • May 2017
        • 58
        • 5.3.x

        #4
        Wayne Luke
        That's right, I totally forgot.
        Sorry for my mistake.
        Attached the .htaccess file renamed to htaccess.txt from the forum root directory.
        Attached Files

        Comment

        • Wayne Luke
          vBulletin Technical Support Lead
          • Aug 2000
          • 73976

          #5
          Move your custom lines above:
          Code:
          	# Main Redirect
          	RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|css)$
          	RewriteCond %{REQUEST_FILENAME} !-f
          	RewriteCond %{REQUEST_FILENAME} !-d
          	RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud demonstration site.
          vBulletin 5 API

          Comment


          • Wayne Luke
            Wayne Luke commented
            Editing a comment
            If that doesn't work, you'll need to create an actual /forumum533 directory
        • user918
          Member
          • May 2017
          • 58
          • 5.3.x

          #6
          Well, I made the adjustment, you can see it in the attachment file.
          Unfortunately without result, nothing is happening.

          wayne Luke
          What do you mean new directory?
          What should the structure look like?

          Directory structure now:
          /var/www/die_seite/forum533/_vb533_Forum_

          Another thing with /forumum533 I have committed myself, it should be called forum533.
          Attached Files

          Comment

          • Wayne Luke
            vBulletin Technical Support Lead
            • Aug 2000
            • 73976

            #7
            The directory should be empty. Just like the AdminCP directory. The only purpose would be to handle redirects.

            vBulletin 5 does everything virtually. Every single URL will ultimately be redirected to index.php even access to the AdminCP. We provide an empty AdminCP directory because some people use .htaccess to block access, even though that is built into the software now. Once a URL gets to index.php, the system looks at it and determines where it should go based on a routing class. It then loads the appropriate page via the index.php script.

            As for my suggestion, it was more of a "Hope this works" than "This will solve the problem" guess. Your use case is not something the software is designed for. We didn't design it so a channel URL can be redirected to a topic URL. You might need to consult an Apache specialist who knows more about mod_rewrite directives. Configurations of this sort fall outside of standard technical support provided by us. What I know about mod_rewrite and Apache is from using Google to try and solve issues like your own.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment

            • alfreema
              Senior Member
              • Sep 2017
              • 144
              • 5.3.x

              #8
              Originally posted by user918
              Well, I made the adjustment, you can see it in the attachment file.
              Unfortunately without result, nothing is happening.

              wayne Luke
              What do you mean new directory?
              What should the structure look like?

              Directory structure now:
              /var/www/die_seite/forum533/_vb533_Forum_

              Another thing with /forumum533 I have committed myself, it should be called forum533.
              1) First off, your rule is commented out ... remove the # at the beginning of the line it or will never fire.


              2) Change ...
              # RewriteRule ^(forumum533/)$ http://test.die_seite.de/forum533/node/14 # does not work.

              To ...

              RewriteRule "^/forum533$" "/forum533/node/14"

              3) Do what Wayne Luke said and move it above the "Main Redirects".

              e.g.

              Code:
                 . . .
              
                  # Redirect old install path to core.
                  RewriteRule ^install/ core/install/ [NC,L]
              
              
                  # My adaptation
                  RewriteRule "^/forum533$" "/forum533/node/14"
              
              
                  # Main Redirect
                  RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|css)$
                  RewriteCond %{REQUEST_FILENAME} !-f
                  RewriteCond %{REQUEST_FILENAME} !-d
                  RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
              
                  . . .
              4) Then test with this exact url:

              http://test.die_seite.de/forum533

              Then report back here with the result. Once you have that working, we should be able to get whatever it is you really want to happen to work.
              Last edited by alfreema; Mon 11 Dec '17, 4:48am.

              Comment

              • user918
                Member
                • May 2017
                • 58
                • 5.3.x

                #9
                The directory should be empty. Just like the AdminCP directory. The only purpose would be to handle redirects.
                Wayne Luke unfortunately, I didn't hear you.
                Do you mean to create another directory in the fourm533 directory, like on the attachment picture?

                I made the adjustment, which alfreema suggested, but unfortunately without result, when calling test.seite.de/forum533 I won't go on test.seite.de/forum533/node/14.


                vBulletin 5 does everything virtually. Every single URL will ultimately be redirected to index.php even access to the AdminCP.
                Is it the index.php on the top level?
                Attached Files

                Comment

                • alfreema
                  Senior Member
                  • Sep 2017
                  • 144
                  • 5.3.x

                  #10
                  Originally posted by user918
                  Wayne Luke unfortunately, I didn't hear you.
                  Do you mean to create another directory in the fourm533 directory, like on the attachment picture?

                  I made the adjustment, which alfreema suggested, but unfortunately without result, when calling test.seite.de/forum533 I won't go on test.seite.de/forum533/node/14.



                  Is it the index.php on the top level?
                  What result did you get? Did it give you an error? Did it redirect somewhere unexpected? What URL do you end up on when put in test.seite.de/forum533 ?

                  Comment

                  • Wayne Luke
                    vBulletin Technical Support Lead
                    • Aug 2000
                    • 73976

                    #11
                    If you're trying to redirect var/www/seite_de/html/forum533 where you have vBulletin installed, the redirect would have to be at the level about it. Still not really sure what you're trying to accomplish here. It is definitely outside the scope of the designed use case for the software to do redirects like this.
                    Translations provided by Google.

                    Wayne Luke
                    The Rabid Badger - a vBulletin Cloud demonstration site.
                    vBulletin 5 API

                    Comment

                    • user918
                      Member
                      • May 2017
                      • 58
                      • 5.3.x

                      #12
                      @alfreema
                      No, no error message as if the statement in the htaccess file was ignored or executed.

                      wayne Luke
                      Still not really sure what you're trying to accomplish here.
                      What I want to achieve is the forwarding of http://test.die_seite.de/forum533 to http://test.die_seite.de/forum533/node/14
                      It doesn't have to be a htaccess feed, maybe someone has an idea how I can do it with PHP redirection.
                      PHP forwarding, it can be a virtual forwarding.
                      The somewhat complicated approach is that the entire forum is located in channel 14 (node ID 14) and with the first call http://test.die_seite.de/forum533/ the node ID 2 is called.
                      That's my problem.
                      Attached Files

                      Comment

                      • Mark.B
                        vBulletin Support
                        • Feb 2004
                        • 24286
                        • 6.0.X

                        #13
                        As Wayne has mentioned, the software simply isn't designed to do this, and it's outside the scope of the support we can provide. Even if you got it working there is no telling what else it might break given that vB5 relies entirely on redirects to function.
                        MARK.B
                        vBulletin Support
                        ------------
                        My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
                        My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

                        Comment

                        • alfreema
                          Senior Member
                          • Sep 2017
                          • 144
                          • 5.3.x

                          #14
                          Originally posted by user918
                          @alfreema
                          No, no error message as if the statement in the htaccess file was ignored or executed.

                          What I want to achieve is the forwarding of http://test.die_seite.de/forum533 to http://test.die_seite.de/forum533/node/14
                          It doesn't have to be a htaccess feed, maybe someone has an idea how I can do it with PHP redirection.
                          PHP forwarding, it can be a virtual forwarding.
                          The somewhat complicated approach is that the entire forum is located in channel 14 (node ID 14) and with the first call http://test.die_seite.de/forum533/ the node ID 2 is called.
                          That's my problem.
                          That should be doable with Apache and you should not need PHP at all.

                          The last attachment you sent was of htaccess.txt. That file is unused and only serves as a backup of the live one, which is .htaccess. The edits you make HAVE to be in .htaccess. Can you verify that you made the changes I recommended in .htaccess?

                          As long as your redirect match string ends with $, it means the url will contain no more characters at all after the last character right before the $. So this rule:

                          RewriteRule "^/forum533$" "/forum533/node/14"

                          Means the URL path must begin (^) with /forum533, and it must end ($) with /forum533

                          e.g.

                          Testing with this should show the behavior you want:

                          This website is for sale! seite.de is your first and best source for information about seite. Here you will also find topics relating to issues of general interest. We hope you find what you are looking for!


                          But testing with this would NOT work with the behavior you want:

                          This website is for sale! seite.de is your first and best source for information about seite. Here you will also find topics relating to issues of general interest. We hope you find what you are looking for!

                          Comment

                          • user918
                            Member
                            • May 2017
                            • 58
                            • 5.3.x

                            #15
                            Regarding the PHP customization.
                            I would like to do without the PHP customization.

                            The htaccess file is on my server as in #10 as. htaccess file, only here in the forum to upload the file.
                            I have the impression that the. htaccess is not "processed" by Apache!
                            Then I ran some tests with other parameters:

                            Code:
                            #RewriteRule "^/forum533$" "/forum533/node/14"
                            #RewriteRule "/forum533$" "/forum533/node/14"
                            #RewriteRule "http://test.seite.de/forum533/$" "http://test.seite.de/forum533/node/14"
                            #RewriteRule "^http://test.seite.de/forum533/$" "http://test.seite.de/forum533/node/14" 
                            #RewriteRule "^http://test.seite.de/forum533/$" "http://test.seite.de/forum533/node/14" [NC,L]
                            #RewriteRule "^forum533/$" "forum533/node/14" [NC,L]
                            #RewriteRule ^forum533/$ forum533/node/14 [NC,L]
                            RewriteRule ^forum533/$ forum533/node/14
                            Unfortunately without visible result, in the logs was also not logged!

                            The rights in the forum directory are as follows:

                            Code:
                            /var/www/seite_de/html/forum533$ ls -lhta
                            insgesamt 428K
                            drwxr-xr-x 11 www-data www-data  12K Dez 14 08:20 .
                            -rw-r--r--  1 www-data www-data 3,9K Dez 14 08:19 .htaccess
                            drwxr-xr-x 58 www-data www-data  12K Dez 13 11:04 ..
                            -rwxr-xr-x  1 www-data www-data 3,1K Dez  8 07:50 index.php
                            -rwxr-xr-x  1 www-data www-data 2,2K Nov  8 10:53 favicon.ico
                            -rwxr-xr-x  1 www-data www-data 3,1K Nov  8 07:39 config.php
                            drwxr-xr-x  8 www-data www-data 4,0K Nov  6 11:29 .git
                            -rw-r--r--  1 www-data www-data    0 Nov  6 08:13 vbdebuglog.log
                            drwxr-xr-x 18 www-data www-data 4,0K Nov  6 08:13 core
                            drwxr-xr-x  7 www-data www-data 4,0K Nov  6 08:06 images
                            drwxr-xr-x  8 www-data www-data  12K Nov  6 08:06 js
                            -rwxr-xr-x  1 www-data www-data 3,1K Okt 19 08:11 config.php.bkp
                            -rwxr-xr-x  1 www-data www-data 3,5K Okt 19 08:11 htaccess.txt
                            -rw-r--r--  1 www-data www-data  29K Okt 19 08:11 LICENSE
                            -rwxr-xr-x  1 www-data www-data 1,1K Okt 19 08:11 vb_favicon.ico
                            -rwxr-xr-x  1 www-data www-data 1,7K Okt 19 08:11 web.config
                            drwxr-xr-x  4 www-data www-data 4,0K Feb  7  2017 css
                            -rw-r--r--  1 www-data www-data 290K Feb  7  2017 forumvb5.css
                            drwxr-xr-x  4 www-data www-data 4,0K Sep  8  2016 includes
                            drwxr-xr-x  2 www-data www-data 4,0K Feb 24  2016 forumrunner
                            drwxr-xr-x 16 www-data www-data 4,0K Feb 24  2016 fonts
                            drwxr-xr-x  4 www-data www-data 4,0K Feb 24  2016 admincp
                            I extended the rights of htaccess file to:
                            Code:
                            -rwxrwxrwx  1 www-data www-data 3,9K Dez 14 08:19 .htaccess
                            Nothing else has changed.

                            We're using Apache version:
                            Code:
                            apache2 -v
                            Server version: Apache/2.2.22 (Debian)
                            Server built:   Jun 25 2017 20:33:16

                            Comment

                            Related Topics

                            Collapse

                            Working...