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

XF 1.4 vB 4.2.x to XenForo 1.4 - Nginx Rule for forum.php

Discussion in 'Installation, Upgrade, and Import Support' started by BoostN, Nov 11, 2014.

  1. BoostN

    BoostN Active Member

    Using NGINX, what rule do I need to rewrite the forum.php to the index.php?

    Current config:
    Code:
    location /{
       rewrite ^/(.*) http://www.$server_name/forum/ permanent;
      }
    
    location /forum/ {
                index index.php index.html index.htm;
                try_files $uri $uri/ /forum/index.php?$uri&$args;
    
            }
    
            location /forum/internal_data/ {
            internal;
            allow 127.0.0.1;
            deny all;
            }
    
            location /forum/library/ {
            internal;
            allow 127.0.0.1;
            deny all;
            }
    
      location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass    127.0.0.1:9000;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include         fastcgi_params;
      }
    I tried adding: rewrite /(forum.php)$ /forum/index.php last; to my forum block but no luck..
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Code:
            location ~* ^/forum\.php$ {
                    rewrite .*
    /index.php last;
            }
    
    That should do it.
     

Share This Page