Want to subscribe to topics you're interested in?
Become a Member

Wordpress Real Physical Media Plugin integration issue

Discussion in 'Blogs & CMS usage' started by Max, Jul 1, 2020.

  1. Max

    Max Member

    90
    5
    8
    Feb 17, 2018
    Ratings:
    +8
    Local Time:
    3:39 PM
    Hello
    i install Real Physical Media Plugin.
    I make a test move the img file.
    But not work. I only a 404 from nginx. Of Wordpress would be normal.
    redirect to the new img file location not work
    the .htaccess should look like this

    Code:
    
    # BEGIN WordPress
    
    # The directives (lines) between `BEGIN WordPress` and `END WordPress` are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    
    # END WordPress   
    
    
    i have no Multisite
    Code:
    # Multisite needs a custom 404 redirect (soft redirect, see also https://stackoverflow.com/a/41824195/5506547)
    ErrorDocument 404 /index.php
    I need to adjust the vhost.?
    If so what must I change.

    thanks Max
     
  2. eva2000

    eva2000 Administrator Staff Member

    44,781
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    12:39 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Nginx doesn't support .htaccess so you need to convert .htaccess Apache rules to Nginx formatted rules. You'd need to ask the plugin author for Nginx rewrite rule equivalents to their .htaccess ones.
     
  3. Max

    Max Member

    90
    5
    8
    Feb 17, 2018
    Ratings:
    +8
    Local Time:
    3:39 PM
    I lack the knowledge to rewrite the rules.
    If there is no suitable converter. htaccess to vhost

    The plugin author says only htaccess.

    where must the new rules be inserted. directly into the vhost?
     
  4. Max

    Max Member

    90
    5
    8
    Feb 17, 2018
    Ratings:
    +8
    Local Time:
    3:39 PM
    Hello
    these rules will work?

    Code:
    location ~* ^/index\.php$ {
        break;
    }
    rewrite ^/([_0-9a-zA-Z-]+/)?wp-admin$ /$1wp-admin/ permanent;
    if (-f $request_filename){
        set $rule_1 1;
    }
    if (-d $request_filename){
        set $rule_1 1;
    }
    if ($rule_1 = "1"){
        break;
    }
    rewrite ^/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) /$2 last;
    rewrite ^/([_0-9a-zA-Z-]+/)?(.*\.php)$ /$2 last;
    rewrite /. /index.php last;
     
  5. eva2000

    eva2000 Administrator Staff Member

    44,781
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    12:39 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    You'd have to ask the web developers and test yourself

    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 :)

    For wordpress manually installed not via centmin.sh menu option 22, the normal permalinks Wordpress nginx rewrite rule for location context = / would just be

    for wordpress installed at web root i.e. domain.com/
    Code (Text):
    location / {
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }
    
     
  6. Max

    Max Member

    90
    5
    8
    Feb 17, 2018
    Ratings:
    +8
    Local Time:
    3:39 PM
    Hello eva2000
    you make a very great support . What you do not have to do.
    i have posted the question in general on the forum. Hoping that someone would answer it.

    A very nice day to you.

    Max