Welcome to Centmin Mod Community
Become a Member

Can you help me for custom permalink vanilla forum in centminmod?

Discussion in 'Forum software usage' started by Tri Wahyu Budi Utomo, Feb 4, 2016.

  1. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x
    Can you help me for custom permalink vanilla forum in centminmod?
    because, standart permalink vanilla forum make a domain.com/index.php?p=/discussions .
    i want to set this to seo friendly permalink. so. domain.com/forum/discussions/post-id/post-name. Can you help me, Please ?
     
  2. dorobo

    dorobo Active Member

    420
    104
    43
    Jun 6, 2014
    Ratings:
    +162
    Local Time:
    8:27 AM
    latest
    latest
  3. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x
    thanks for help me sir, but this tutor can't try. but after I tried no change. If it is demonstrated to be acceptable to rewrite the location where the permalink?

    whether it is in/usr/local/nginx/conf/conf.d/domain.com.conf?
     
  4. dorobo

    dorobo Active Member

    420
    104
    43
    Jun 6, 2014
    Ratings:
    +162
    Local Time:
    8:27 AM
    latest
    latest
    post the content of your domain.com.conf
     
  5. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x
    this is domain.conf rewrite

    what i miss it?
    Code:
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    #server {
    #            listen   80;
    #            server_name domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
      server_name domainl.com www.domain.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      # access_log /home/nginx/domains/domain.com/log/access.log combined buffer=32k;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      root /home/nginx/domains/domain.com/public;
    
      location / {
    try_files $uri $uri/ /index.php?q=$request_uri;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
    # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Enable for vBulletin usage WITHOUT vbSEO installed
    #try_files              $uri $uri/ /index.php;
    
    
    location ~ \.php {
          try_files $uri =404;
          fastcgi_pass unix:/var/run/php5-fpm.sock ;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
          fastcgi_split_path_info ^(.+\.php)(.*)$;
      }
      }
    # Forum locations
      location ~ ^forum {
          index  index.php;
          try_files $uri $uri/ @forum;
      }
    
    # rewrite
      location @forum {   
        #pretty urls
            rewrite ^/forum(/.*)?$ /forum/index.php?p=$1 last;
      }
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
    
    }
     
  6. dorobo

    dorobo Active Member

    420
    104
    43
    Jun 6, 2014
    Ratings:
    +162
    Local Time:
    8:27 AM
    latest
    latest
    try changing this

    Code:
    # Forum locations
      location ~ ^forum {
          index  index.php;
          try_files $uri $uri/ @forum;
      }
    
    # rewrite
      location @forum {
        #pretty urls
            rewrite ^/forum(/.*)?$ /forum/index.php?p=$1 last;
      }
    to this

    Code:
    location /forum {
    try_files $uri $uri/ @forum;
    }
    location @forum {
    rewrite ^/forum(.+)$ /forum/index.php?p=$1 last;
    }
     
  7. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    10:27 AM
    Nginx 1.13.x
    MariaDB 5.5
    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such.

    However, Centmin Mod users are free to help each other out and ask questions or give answers on this community forum. My hopes are that this community forum evolves so that more veteran long time Centmin Mod users help new Centmin Mod users out :)

    But from you above posted domain.com.conf, you can remove this part
    Code:
    location ~ \.php {
          try_files $uri =404;
          fastcgi_pass unix:/var/run/php5-fpm.sock ;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
          fastcgi_split_path_info ^(.+\.php)(.*)$;
      }
    as it's duplicated as all nginx vhosts by default have an include file php.conf at
    Code:
      include /usr/local/nginx/conf/php.conf;
    which already contains the location match
     
  8. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x

    Thank you... work it.... and now move at subdomain not subfolder ... thank again :)
     
    • Like Like x 1
  9. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x
    sorry, ask again.
    After I tried the permalink can already replace, but when in the category articles, click appear 404 not found. can you help me this problem? :)
     
  10. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    10:27 AM
    Nginx 1.13.x
    MariaDB 5.5
    what permanlink format did you use ? does it have .html extensions ?

    In other words, are you using Wordpress permalinks or Nginx rewrite rules which have urls/links with .html extensions ?

    Centmin Mod default static files include file at /usr/local/nginx/conf/staticfiles.conf handles .html files via Nginx. But by using wordpress with .html extensions you tell Nginx not to serve .html files and serve via PHP-FPM (not ideal as it reduces performance if you use permalinks with .html extensions and thus use PHP-FPM to server .html files)

    If you must use .html extension permalinks, you need to comment out the .html location context from /usr/local/nginx/conf/staticfiles.conf and restart Nginx server as illustrated below with hash # in front
    Code:
    location ~* \.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ {
    gzip_static off;
    #add_header Pragma public;
    add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    access_log off;
    expires 30d;
    break;
    }
    
    location ~* \.(js)$ {
    #add_header Pragma public;
    add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    access_log off;
    expires 30d;
    break;
    }
    
    location ~* \.(css)$ {
    #add_header Pragma public;
    add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    access_log off;
    expires 30d;
    break;
    }
    
    #location ~* \.(html|htm|txt)$ {
    #add_header Pragma public;
    #add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    #access_log off;
    #expires 1d;
    # break;
    # }
    
    location ~* \.(eot|svg|ttf|woff)$ {
    #add_header Pragma public;
    add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    access_log off;
    expires 30d;
    break;
    }
    
    You can also use SSH command shortcut below to launch nano linux text editor and edit file /usr/local/nginx/conf/staticfiles.conf
    Code:
    statfilesinc
     
  11. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x
    not use .html extension... you can cek this forum.digitalponsel.com . content can't be open :(
     
  12. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    10:27 AM
    Nginx 1.13.x
    MariaDB 5.5
    To troubleshoot Nginx and PHP-FPM issues you'd want to check the domain site's vhost access.log and error.log logs located within directory at /home/nginx/domains/yourdomain.com/logs. You can see a full overview at centminmod.com/configfiles.html

    FAQ item 19 has more info on all Centmin Mod relevant log files locations and how to use tail command to view a sample of the entries.

    Also post the contents of your site's nginx vhost http /usr/local/nginx/conf/conf.d/yourdomain.com.conf and/or /usr/local/nginx/conf/conf.d/yourdomain.com.ssl.conf in BBCODE CODE tags as outlined at How to use forum BBCODE code tags | Centmin Mod Community
     
  13. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x
  14. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    10:27 AM
    Nginx 1.13.x
    MariaDB 5.5
  15. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x
    sorry. this is url BigDinosaur Blog
     
  16. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    10:27 AM
    Nginx 1.13.x
    MariaDB 5.5
    oh BigDinosaur Blog if you have additional vanilla nginx settings needed then yes you need to add them

    however, never used vanilla so no idea myself
     
  17. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x
    to add the settings How do I? I tried failed to hold.
     
  18. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    10:27 AM
    Nginx 1.13.x
    MariaDB 5.5
    to edit and add them, edit your site's nginx vhost http /usr/local/nginx/conf/conf.d/yourdomain.com.conf and/or /usr/local/nginx/conf/conf.d/yourdomain.com.ssl.conf

    as to specifically what to add you might want to ask vanilla support for the correct nginx rewrite rules and then post what they say here
     
  19. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x
    Ok thank you. i will try
     
  20. Tri Wahyu Budi Utomo

    Tri Wahyu Budi Utomo New Member

    19
    2
    3
    Feb 4, 2016
    Ratings:
    +2
    Local Time:
    7:27 AM
    Nginx 1.9.10
    MariaDB 10.0.x
    oh yaa, can you make idea other cms forum free but support centminmod?