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

Wordpress nginx rewrite question

Discussion in 'Blogs & CMS usage' started by Mastergumble, Oct 6, 2016.

  1. Mastergumble

    Mastergumble New Member

    21
    5
    3
    Sep 29, 2016
    Ratings:
    +8
    Local Time:
    10:11 PM
    1.11.x
    10.x
    I digging into this but so far none of the tests id it...

    I currently have WP permalinks set to /%postname%/ and it shows:

    domain.com/home/page/

    How can I turn into domain.com/page/
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,584
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,774
    Local Time:
    7:11 AM
    Nginx 1.13.x
    MariaDB 5.5
    permalinks is only for posts AFAIK, wp pages don't have a corresponding friendly url setting in wordpress ?
     
  3. Mastergumble

    Mastergumble New Member

    21
    5
    3
    Sep 29, 2016
    Ratings:
    +8
    Local Time:
    10:11 PM
    1.11.x
    10.x
    That's the only setting AFAIK...

    Have been testing some different rewrites but none did the trick.
     
  4. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,584
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,774
    Local Time:
    7:11 AM
    Nginx 1.13.x
    MariaDB 5.5
    can't you just edit the wp page in admin and change the permalink url itself ?
     
  5. Mastergumble

    Mastergumble New Member

    21
    5
    3
    Sep 29, 2016
    Ratings:
    +8
    Local Time:
    10:11 PM
    1.11.x
    10.x
  6. Mastergumble

    Mastergumble New Member

    21
    5
    3
    Sep 29, 2016
    Ratings:
    +8
    Local Time:
    10:11 PM
    1.11.x
    10.x
    Was trying to figure something around this

    rewrite ^/home(/.*)$ $1 last;

    but so far no cookie
     
  7. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,584
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,774
    Local Time:
    7:11 AM
    Nginx 1.13.x
    MariaDB 5.5
    did you use centmin.sh menu option 22 and instaleld wordpress into a subdirectory called home so domain.com/home ? that would explain the problem as you shouldn't have installed wordpress in subdirectory and let it install at / so domain.com/
     
  8. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,584
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,774
    Local Time:
    7:11 AM
    Nginx 1.13.x
    MariaDB 5.5
  9. Mastergumble

    Mastergumble New Member

    21
    5
    3
    Sep 29, 2016
    Ratings:
    +8
    Local Time:
    10:11 PM
    1.11.x
    10.x
    No

    Installed without subdirectory step by step using last beta
     
  10. Mastergumble

    Mastergumble New Member

    21
    5
    3
    Sep 29, 2016
    Ratings:
    +8
    Local Time:
    10:11 PM
    1.11.x
    10.x
    The full path atm /home/nginx/domains/domain.com/public/
     
  11. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,584
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,774
    Local Time:
    7:11 AM
    Nginx 1.13.x
    MariaDB 5.5
    what's output for these commands

    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp option get siteurl --allow-root
    wp option get home --allow-root
    

    if you don't get anything then try
    Code (Text):
    cd /home/nginx/domains/domain.com/public/home
    wp option get siteurl --allow-root
    wp option get home --allow-root
    
     
  12. Mastergumble

    Mastergumble New Member

    21
    5
    3
    Sep 29, 2016
    Ratings:
    +8
    Local Time:
    10:11 PM
    1.11.x
    10.x
    What a big mess

    Code:
    <div class="alert"><span class="object">id: mp_row, name: Row, icon: , closeType: enclosed, resize: none, position: 0, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/no-object.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_row_inner, name: Inner Row, icon: , closeType: enclosed, resize: none, position: 0, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/no-object.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_span, name: Column, icon: , closeType: enclosed, resize: none, position: 0, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/no-object.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_span_inner, name: Inner Column, icon: , closeType: enclosed, resize: none, position: 0, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/no-object.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_text, name: Paragraph, icon: , closeType: enclosed, resize: horizontal, position: 20, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/text.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_heading, name: Title, icon: , closeType: enclosed, resize: horizontal, position: 10, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/heading.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_code, name: WordPress Text, icon: , closeType: enclosed, resize: horizontal, position: 30, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_quote, name: Quote, icon: , closeType: enclosed, resize: horizontal, position: 40, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/quotes.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_members_content, name: Members Content, icon: , closeType: enclosed, resize: horizontal, position: 50, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/members.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_image, name: Image, icon: , closeType: self-closed, resize: horizontal, position: 10, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/image.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_image_slider, name: Slider, icon: , closeType: self-closed, resize: horizontal, position: 20, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/image-slider.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_grid_gallery, name: Grid Gallery, icon: , closeType: self-closed, resize: horizontal, position: 30, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/grid-gallery.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_button, name: Button, icon: , closeType: self-closed, resize: horizontal, position: 10, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/button.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_social_buttons, name: Social Share Buttons, icon: , closeType: enclosed, resize: horizontal, position: 20, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/social-buttons.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_social_profile, name: Social Buttons, icon: , closeType: self-closed, resize: horizontal, position: 30, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/social-profile.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_video, name: Video, icon: , closeType: self-closed, resize: horizontal, position: 10, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/video.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_audio, name: Audio, icon: , closeType: enclosed, resize: horizontal, position: 20, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/player.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_gmap, name: Google Maps, icon: , closeType: self-closed, resize: all, position: 60, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/map.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_space, name: Space, icon: , closeType: self-closed, resize: all, position: 50, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/space.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_embed, name: Embed, icon: , closeType: self-closed, resize: horizontal, position: 40, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/code.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_google_chart, name: Chart, icon: , closeType: enclosed, resize: all, position: 30, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/chart.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_tabs, name: Tabs, icon: , closeType: enclosed, resize: horizontal, position: 20, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/tabs.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_tab, name: Tab, icon: , closeType: enclosed, resize: none, position: 0, show: </span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/no-object.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_accordion, name: Accordion, icon: , closeType: enclosed, resize: horizontal, position: 11, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/accordion.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_accordion_item, name: Accordion Section, icon: , closeType: enclosed, resize: none, position: 0, show: </span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/no-object.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_table, name: Table, icon: , closeType: enclosed, resize: horizontal, position: 10, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/table.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_posts_grid, name: Posts Grid, icon: , closeType: self-closed, resize: horizontal, position: 0, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/posts-grid.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_archives, name: Archives, icon: , closeType: self-closed, resize: horizontal, position: 45, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_calendar, name: Calendar, icon: , closeType: self-closed, resize: horizontal, position: 30, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_categories, name: Categories, icon: , closeType: self-closed, resize: horizontal, position: 40, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_navmenu, name: Custom Menu, icon: , closeType: self-closed, resize: horizontal, position: 10, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_meta, name: Meta, icon: , closeType: self-closed, resize: horizontal, position: 55, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_pages, name: Pages, icon: , closeType: self-closed, resize: horizontal, position: 15, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_posts, name: Recent Posts, icon: , closeType: self-closed, resize: horizontal, position: 20, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_comments, name: Recent Comments, icon: , closeType: self-closed, resize: horizontal, position: 25, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_rss, name: RSS, icon: , closeType: self-closed, resize: horizontal, position: 50, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_search, name: Search, icon: , closeType: self-closed, resize: horizontal, position: 35, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_tagcloud, name: Tag Cloud, icon: , closeType: self-closed, resize: horizontal, position: 60, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/wordpress.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wp_widgets_area, name: Widgets Area, icon: , closeType: self-closed, resize: horizontal, position: 5, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/object/sidebar.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_grid, name: Grid, icon: , position: 0, show: </span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/group/no-group.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_text, name: Text, icon: , position: 0, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/group/no-group.png does not exist</li><li>File //images/ce/group/text.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_image, name: Image, icon: , position: 10, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/group/no-group.png does not exist</li><li>File //images/ce/group/image.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_button, name: Button, icon: , position: 20, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/group/no-group.png does not exist</li><li>File //images/ce/group/button.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_media, name: Media, icon: , position: 30, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/group/no-group.png does not exist</li><li>File //images/ce/group/media.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_other, name: Other, icon: , position: 40, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/group/no-group.png does not exist</li><li>File //images/ce/group/other.png does not exist</li></ul></li></ul></div><div class="alert"><span class="object">id: mp_wordpress, name: WordPress, icon: , position: 50, show: 1</span><ul class="property"><li>icon:<ul class="errors"><li>File //images/ce/group/no-group.png does not exist</li><li>File //images/ce/group/wordpress.png does not exist</li></ul></li></ul></div>PHP Warning:  require_once(//includes/getLanguageDict.php): failed to open stream: No such file or directory in /home/nginx/domains/domain.com/public/wp-content/plugins/motopress-content-editor/includes/ce/templates/landing.php on line 3
    Warning: require_once(//includes/getLanguageDict.php): failed to open stream: No such file or directory in /home/nginx/domains/domain.com/public/wp-content/plugins/motopress-content-editor/includes/ce/templates/landing.php on line 3
    PHP Fatal error:  require_once(): Failed opening required '//includes/getLanguageDict.php' (include_path='phar:///usr/bin/wp/vendor/phpunit/php-token-stream:phar:///usr/bin/wp/vendor/phpunit/phpunit-mock-objects:phar:///usr/bin/wp/vendor/phpunit/php-code-coverage:phar:///usr/bin/wp/vendor/phpunit/phpunit:phar:///usr/bin/wp/vendor/symfony/yaml:.:/usr/local/lib/php') in /home/nginx/domains/domain.com/public/wp-content/plugins/motopress-content-editor/includes/ce/templates/landing.php on line 3
    Fatal error: require_once(): Failed opening required '//includes/getLanguageDict.php' (include_path='phar:///usr/bin/wp/vendor/phpunit/php-token-stream:phar:///usr/bin/wp/vendor/phpunit/phpunit-mock-objects:phar:///usr/bin/wp/vendor/phpunit/php-code-coverage:phar:///usr/bin/wp/vendor/phpunit/phpunit:phar:///usr/bin/wp/vendor/symfony/yaml:.:/usr/local/lib/php') in /home/nginx/domains/domain.com/public/wp-content/plugins/motopress-content-editor/includes/ce/templates/landing.php on line 3
    
     
  13. Mastergumble

    Mastergumble New Member

    21
    5
    3
    Sep 29, 2016
    Ratings:
    +8
    Local Time:
    10:11 PM
    1.11.x
    10.x
    I guess something blow during install, I did a second install with other domain and everything seems normal

    I will remove this domain and recreate it
     
    • Informative Informative x 1
  14. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,584
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,774
    Local Time:
    7:11 AM
    Nginx 1.13.x
    MariaDB 5.5
    looks like a language, theme or plugin is interferring with wp-cli commands

    or wpsecure include file is blocking that plugin so you need to whitelist it so in your /usr/local/nginx/conf/wpincludes/${vhostname}/wpsecure_${vhostname}.conf where ${vhostname} is your domain.com name add to the top or under #prepare for letsencrypt location a new whitelisted location

    replace all instances of ${vhostname} with your domain.com name
    Code (Text):
    # Whitelist Exception for https://wordpress.org/plugins/motopress-content-editor/
    location ~ ^/wp-content/plugins/motopress-content-editor/ {
      location ~ ^/wp-content/plugins/motopress-content-editor/(.+/)?(.+)\.(php)$ { allow all; }
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/${vhostname}/wpsecure_${vhostname}.conf
      #include /usr/local/nginx/conf/wpincludes/${vhostname}/wpwhitelist_common.conf;
    }


    what happens when you temporarily disable motopress-content-editor plugin and try those commands again

    from wp plugin | WP-CLI

    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp plugin deactivate motopress-content-editor --allow-root
    wp option get siteurl --allow-root
    wp option get home --allow-root
    wp plugin activate motopress-content-editor --allow-root
    


    OR is plugin named motopress-content-editor-lite ?
     
    Last edited: Oct 6, 2016
  15. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,584
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,774
    Local Time:
    7:11 AM
    Nginx 1.13.x
    MariaDB 5.5
  16. Mastergumble

    Mastergumble New Member

    21
    5
    3
    Sep 29, 2016
    Ratings:
    +8
    Local Time:
    10:11 PM
    1.11.x
    10.x
    Just found it!

    It is the XML I used to export content from production site, for some reason it adds the /home everywhere!

    Crazy thing...
     
    • Informative Informative x 1
  17. eva2000

    eva2000 Administrator Staff Member

    29,016
    6,584
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,774
    Local Time:
    7:11 AM
    Nginx 1.13.x
    MariaDB 5.5
    ah that would explain it !