Redirector do not seems to work on Vanilla 3.3

Hello,

My Vanilla 3.3 instance at https://forum.pluxml.org was imported from a punBB forum. The Redirector 1.3 plugin is activated but don't seems to work.

This punBB URL : https://forum.pluxml.org/viewtopic.php?id=4532

Is not redirected to : https://forum.pluxml.org/discussion/4532

And I don't see why.

image.png


Comments

  • BleistivtBleistivt Moderator
    edited March 2021

    Note that you don't need the redirector plugin. Just visit /dashboard/routes and add a route:

    viewtopic.php\?id=(.*)
    discussion/$1
    Permanent (301)
    
  • Hi, thanks for your help. I tried both solution without success. I also try to add a redirect rule directly in the apache virtualhost, and in the .htaccess but I still get a 404 on a the punBB URL.

    Here is the .htaccess (I use the Vanilla default one)

    # Original
    # If you modify this file then change the above line to: # Modified
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        ####
        # Certain hosts may require the following line.
        # If vanilla is in a subfolder then you need to specify it after the /.
        # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
        ####
        #RewriteBase /
    
        # Make sure that / doesn't try to go to index.php without a rewrite :)
        DirectoryIndex disabled
    
        ####
        # Deny access to certain directories that SHOULD NOT be exposed.
        ####
        RewriteRule (^|/)\.git - [L,R=403]
        RewriteRule ^cache/ - [L,R=403]
        RewriteRule ^cgi-bin/ - [L,R=403]
        RewriteRule ^uploads/import/ - [L,R=403]
        RewriteRule ^vendor/ - [L,R=403]
    
        ####
        # Prevent access to any php script by redirecting the request to /index.php
        # You can add an exception by adding another RewriteCond after this one.
        # Example: RewriteCond %{REQUEST_URI} !^/yourscriptname.php$
        # You can comment out this section if it causes you problems.
        # This is just a nice to have for security purposes.
        ####
        RewriteCond %{REQUEST_URI} !/index.php$
        RewriteRule (.+\.php) [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
    
        ####
        # Redirect any non existing file/directory to /index.php
        ####
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule (.*) index.php [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
    
        ####
        # Add the proper X_REWRITE server variable for rewritten requests.
        ####
        RewriteCond %{ENV:REDIRECT_X_REWRITE} .+
        RewriteCond %{ENV:REDIRECT_X_PATH_INFO} (.+)
        RewriteRule ^index\.php - [E=X_REWRITE:1,E=!REDIRECT_X_REWRITE,E=X_PATH_INFO:%1,E=!REDIRECT_X_PATH_INFO,L]
        
        <IfModule mod_setenvif.c>
            ####
            # Pass Authorization header to php environment variable to support API authentication
            ####
            SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
        </IfModule>
    </IfModule>
    
    <IfModule mod_headers.c>
       <FilesMatch "(?<!embed)\.(css|js|woff|ttf|eot|svg|png|gif|jpeg|jpg|ico|swf)$">
          Header set Cache-Control "max-age=315360000"
          Header set Expires "31 December 2037 23:59:59 GMT"
       </FilesMatch>
    </IfModule>
    
    
    

    And the route from the dashboard :

    image.png


  • KasparKaspar ✭✭✭
    #RewriteBase /
    


    is commented out

Sign In or Register to comment.