Welcome to Centmin Mod Community
Register Now

Domains Permalink Not working

Discussion in 'Domains, DNS, Email & SSL Certificates' started by gamal, Mar 5, 2020.

  1. gamal

    gamal Member

    99
    8
    8
    Jan 31, 2018
    Ratings:
    +11
    Local Time:
    10:31 PM
    1.13.8
    Dear @eva2000 ,

    i have my website www.3alamtaney.com and i make redirect all to عالم تاني اكبر موقع ثقافي علمي فى العالم العربي, that went fine, but...

    when i tried to change permalinks also from
    Code:
    https:/www.3alamtaney.com/123 
    to
    Code:
    https://www.3alamtaney.com/ماهو-نظام-iptv-وما-مميزاته/
    it gives me erro, i'm using cloudflare with full ssl, i'm really lost on this one and i tried to restart nginx through nprestart, also tried to re-save permalink option as recommended in wordpress forum.

    P.S: i have rank math seo plugin that have redirect plugin into it, i managed to make redirects from old URL to the new one, worked once then all posts now give error. pls help..


    Thx in advance

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,229
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    10:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what errors ? specific error messages ?

    unfortunately no idea if non-English wordpress permalinks are supported by Wordpress
     
  3. gamal

    gamal Member

    99
    8
    8
    Jan 31, 2018
    Ratings:
    +11
    Local Time:
    10:31 PM
    1.13.8
    it is supported same as english and lots of other websites uses them with no problem, i guess there is a problem in my ssl config file or something:

    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For HTTP/2 SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from non www to www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    server {
     server_name 3alamtaney.com www.3alamtaney.com;
     return 301 https://www.$server_name$request_uri;
    }
    server {
      listen 443 ssl http2;
      server_name 3alamtaney.com www.3alamtaney.com;
    
    ssl_dhparam /usr/local/nginx/conf/ssl/3alamtaney.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/3alamtaney.com/3alamtaney.com-acme.cer;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/3alamtaney.com/3alamtaney.com-acme.key;
      include /usr/local/nginx/conf/ssl_include.conf;
                                                                                      
    
      # cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/
      #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/3alamtaney.com/origin.crt;
      #ssl_verify_client on;
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      http2_max_requests 5000;
      # mozilla recommended
      ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
      ssl_prefer_server_ciphers   on;
      #add_header Alternate-Protocol  443:npn-spdy/3;
    
      # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
      #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
      #add_header X-Frame-Options SAMEORIGIN;
      add_header X-Xss-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
      #add_header Feature-Policy "accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'";
      #spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
     
      # enable ocsp stapling
      resolver 8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 valid=10m;
      resolver_timeout 10s;
      ssl_stapling on;
      ssl_stapling_verify on;
      ssl_trusted_certificate /usr/local/nginx/conf/ssl/3alamtaney.com/3alamtaney.com-fullchain-acme.key; 
    
    # 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/3alamtaney.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/3alamtaney.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/3alamtaney.com/autoprotect-3alamtaney.com.conf;
      root /home/nginx/domains/3alamtaney.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      #include /usr/local/nginx/conf/wpincludes/3alamtaney.com/wpcacheenabler_3alamtaney.com.conf;
      include /usr/local/nginx/conf/wpincludes/3alamtaney.com/wpsupercache_3alamtaney.com.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/wpincludes/3alamtaney.com/rediscache_3alamtaney.com.conf; 
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
     
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
      #try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args; 
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    
    location ~* /(wp-login\.php) {
        limit_req zone=xwplogin burst=1 nodelay;
        #limit_conn xwpconlimit 30;
        #auth_basic "Private";
        #auth_basic_user_file /home/nginx/domains/3alamtaney.com/htpasswd_wplogin;   
        include /usr/local/nginx/conf/php-wpsc.conf;
        
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /(xmlrpc\.php) {
        limit_req zone=xwprpc burst=45 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
        
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-scripts\.php) {
        limit_req zone=xwprpc burst=5 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
        
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-styles\.php) {
        limit_req zone=xwprpc burst=5 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
        
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
      include /usr/local/nginx/conf/wpincludes/3alamtaney.com/wpsecure_3alamtaney.com.conf;
      include /usr/local/nginx/conf/php-wpsc.conf;
     
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/php-rediscache.conf;
      include /usr/local/nginx/conf/pre-staticfiles-local-3alamtaney.com.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
    the error that appear on every post but not on home page or taxonomy pages
    Code:
    “There has been a critical error on your website. Please check your site admin email inbox for instructions.
    
    Learn more about debugging in WordPress.”
    
    
    also when i use chrome console i see these errors

    Code:
    dw4sx0xk0hu8c.cloudfront.net/contentDocumentStart.js:1 Failed to load resource: the server responded with a status of 403 ()
    
    localhost:8080/contentDocumentStart.js:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
    
    www.3alamtaney.com/:1 Failed to load resource: the server responded with a status of 500 ()
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,229
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    10:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    No entirely related to your issue but you have nginx non-http to https redirect misconfiguration, posted at centminmod.com/nginx_domain_dns_setup.html#httpsredirect is the correct way to set it up - pay attention to different way if you want redirect target being www version instead of non-www and vice versa and that the target version www or non-www is the only version listed in server_name for the 2nd/main server {} context.

    If you prefer www domain i.e. https://wwww.newdomain.com to be the intended redirect target, you will have add a 3rd server{} context to your Nginx HTTPS SSL vhost config file as outlined here.

    Code (Text):
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For HTTP/2 SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from www to non-www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
     server {
       server_name newdomain.com www.newdomain.com;
       return 302 https://www.newdomain.com$request_uri;
     }
    
    server {
      listen 443 ssl http2;
      server_name newdomain.com;
      return 302 https://www.newdomain.com$request_uri;
    
      ssl_dhparam /usr/local/nginx/conf/ssl/newdomain.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.crt;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.key;
      include /usr/local/nginx/conf/ssl_include.conf;
    }
    
    server {
      listen 443 ssl http2;
      server_name www.newdomain.com;
    
      ssl_dhparam /usr/local/nginx/conf/ssl/newdomain.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.crt;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.key;
      include /usr/local/nginx/conf/ssl_include.conf;
    
    < snipped the rest of the nginx settings >

    Notice the middle server{} context tells Nginx to redirect non-www domain HTTPS requests to www domain HTTPS requests for www domain on third server{} context. While first server{} context tells Nginx to redirect both non-HTTPS non-www and www domain requests to HTTPS requests for www domain on third server{} context.

    key to testing is using 302 temp redirect first in a private incognito browser session otherwise the problems you can experience may end up being due to browser caching or 301 permanent redirects unless you clear browser cache and reboot local computer(s) and even then some web browsers don't let go of 301 permanent redirect browser cache that willingly :)

    You can test in SSH via curl to check headers for location field (where the redirect goes) using the following commands:
    Code (Text):
    curl -I http://domain.com
    

    Code (Text):
    curl -I http://www.domain.com
    
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,229
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    10:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    did you disable rank math seo plugin and disable redirect plugin to it, does it fix it ?
     
  6. gamal

    gamal Member

    99
    8
    8
    Jan 31, 2018
    Ratings:
    +11
    Local Time:
    10:31 PM
    1.13.8
    i have disabled the rank math redirection plugin, but the result is the same.

    this is the result of CURL command

    Code:
    curl -I http://3alamtaney.com
    HTTP/1.1 301 Moved Permanently
    Date: Fri, 06 Mar 2020 01:05:51 GMT
    Connection: keep-alive
    Cache-Control: max-age=3600
    Expires: Fri, 06 Mar 2020 02:05:51 GMT
    Location: https://3alamtaney.com/
    Server: cloudflare
    CF-RAY: 56f82bbbdb8ad90d-AMS
    
    Code:
    curl -I http://www.3alamtaney.com
    HTTP/1.1 301 Moved Permanently
    Date: Fri, 06 Mar 2020 01:06:35 GMT
    Connection: keep-alive
    Cache-Control: max-age=3600
    Expires: Fri, 06 Mar 2020 02:06:35 GMT
    Location: https://www.3alamtaney.com/
    Server: cloudflare
    CF-RAY: 56f82ccd4ec9c83b-AMS
    
     
  7. gamal

    gamal Member

    99
    8
    8
    Jan 31, 2018
    Ratings:
    +11
    Local Time:
    10:31 PM
    1.13.8
    i noticed something that is strange to me and the first time that occur in my experience with wordpress..

    if i copy & paste the redirect url from rank math redirection plugin, the post show and everything is fine.

    but when i try to visit the same post from home page or category page it give the mentioned error before:

    link from Rank Math

    Code:
    https://www.3alamtaney.com/اربعة-خطوات-عملية-لتعلم-الكتابة-كمحتر/
    i suspect it maybe a cache problem, so i clear autoptmize cace, WP Super Cache and cloud Flare Cache,

    on the first click it give the same error, but when i refresh i can see the post with no problem !!!

    just to make my problem more strange, hitting the url area with enter get the post showing right, clicking refresh button on the toolbar will make it give the same mentioned error before and this behaviour is the same with firefox chrome and brave browser after clearing all the browsers history, so i really don't know what si happening !!
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,229
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    10:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    You using wp super cache as configured by centmin.sh menu option 22 or manually installed yourself with a previous centmin mod auto installed cache method in place ? if previous installed cache method in place, what was it ?
     
  9. eva2000

    eva2000 Administrator Staff Member

    55,229
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    10:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah as i outlined Domains - Permalink Not working you need a 3rd server() context so that the above 2 curl commands both redirect to Location = with your main www version of your domain. Right now 1st curl command for non-https + non-www redirects to non-www and not www HTTPS site
     
  10. gamal

    gamal Member

    99
    8
    8
    Jan 31, 2018
    Ratings:
    +11
    Local Time:
    10:31 PM
    1.13.8
    ok i have done the 3 servers and here is the conf file, after applying the changes and restart the server when visit it give me error of too many redirects:

    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For HTTP/2 SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from non www to www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    server {
     server_name 3alamtaney.com www.3alamtaney.com;
     return 301 https://www.$server_name$request_uri;
    }
    server {
      listen 443 ssl http2;
      server_name 3alamtaney.com;
      return 301 https://www.3alamtaney.com$request_uri;
      ssl_dhparam /usr/local/nginx/conf/ssl/3alamtaney.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/3alamtaney.com/3alamtaney.com-acme.cer;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/3alamtaney.com/3alamtaney.com-acme.key;
      include /usr/local/nginx/conf/ssl_include.conf;
    }                                                                                
    server {
      listen 443 ssl http2;
      server_name www.3alamtaney.com;
    
      ssl_dhparam /usr/local/nginx/conf/ssl/3alamtaney.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/3alamtaney.com/3alamtaney.com-acme.cer;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/3alamtaney.com/3alamtaney.com-acme.key;
      include /usr/local/nginx/conf/ssl_include.conf;
      # cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/
      #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/3alamtaney.com/origin.crt;
      #ssl_verify_client on;
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      http2_max_requests 5000;
      # mozilla recommended
      ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
      ssl_prefer_server_ciphers   on;
      #add_header Alternate-Protocol  443:npn-spdy/3;
    
      # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
      #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
      #add_header X-Frame-Options SAMEORIGIN;
      add_header X-Xss-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
      #add_header Feature-Policy "accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'";
      #spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
     
      # enable ocsp stapling
      resolver 8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 valid=10m;
      resolver_timeout 10s;
      ssl_stapling on;
      ssl_stapling_verify on;
      ssl_trusted_certificate /usr/local/nginx/conf/ssl/3alamtaney.com/3alamtaney.com-fullchain-acme.key;
    
    # 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/3alamtaney.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/3alamtaney.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/3alamtaney.com/autoprotect-3alamtaney.com.conf;
      root /home/nginx/domains/3alamtaney.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      #include /usr/local/nginx/conf/wpincludes/3alamtaney.com/wpcacheenabler_3alamtaney.com.conf;
      include /usr/local/nginx/conf/wpincludes/3alamtaney.com/wpsupercache_3alamtaney.com.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/wpincludes/3alamtaney.com/rediscache_3alamtaney.com.conf;
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
     
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
      #try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    
    location ~* /(wp-login\.php) {
        limit_req zone=xwplogin burst=1 nodelay;
        #limit_conn xwpconlimit 30;
        #auth_basic "Private";
        #auth_basic_user_file /home/nginx/domains/3alamtaney.com/htpasswd_wplogin;  
        include /usr/local/nginx/conf/php-wpsc.conf;
       
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /(xmlrpc\.php) {
        limit_req zone=xwprpc burst=45 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
       
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-scripts\.php) {
        limit_req zone=xwprpc burst=5 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
       
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-styles\.php) {
        limit_req zone=xwprpc burst=5 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
       
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
      include /usr/local/nginx/conf/wpincludes/3alamtaney.com/wpsecure_3alamtaney.com.conf;
      include /usr/local/nginx/conf/php-wpsc.conf;
     
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/php-rediscache.conf;
      include /usr/local/nginx/conf/pre-staticfiles-local-3alamtaney.com.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
    Error:
    Code:
    This page isn’t working
    www.3alamtaney.com redirected you too many times.
    Try clearing your cookies.
    ERR_TOO_MANY_REDIRECTS
     
  11. eva2000

    eva2000 Administrator Staff Member

    55,229
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    10:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    What's output for these commands changing /home/nginx/domains/domain.com/public/ to the path to where you installed wordpress i.e. if domain.com/blog then it would be /home/nginx/domains/domain.com/public/blog
    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp option get siteurl --allow-root
    wp option get home --allow-root
    

    If siteurl and home values are coming up with non-www and you want www being the main destination you can change them in your wordpress generation url settings or more thoroughly via wp-cli command line
    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp search-replace 'https://example.com' 'https://www.example.com' --skip-columns=guid
    

    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp option update home 'https://www.example.com'
    wp option update siteurl 'https://www.example.com'
    

    And same in reverse, if siteurl and home values are coming up with www and you want non-www being the main destination you can change them in your wordpress generation url settings or more thoroughly via wp-cli command line
    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp search-replace 'https://www.example.com' 'https://example.com' --skip-columns=guid
    

    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp option update home 'https://example.com'
    wp option update siteurl 'https://example.com'
    
     
  12. gamal

    gamal Member

    99
    8
    8
    Jan 31, 2018
    Ratings:
    +11
    Local Time:
    10:31 PM
    1.13.8
    Hello,

    Here are the results
    Code:
    [07:27][root@alpha.3alamtaney.com public]# wp option get siteurl --allow-root   https://www.3alamtaney.com
    [07:27][root@alpha.3alamtaney.com public]# wp option get home --allow-root
    https://www.3alamtaney.com
    [07:27][root@alpha.3alamtaney.com public]#
    
    also i have done the replacement part which actually changed nothing, again with siteurl and home changing nothing. and the redirect error message is still appearing
     
  13. eva2000

    eva2000 Administrator Staff Member

    55,229
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    10:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    for redirect error, if you remove both redirects below and restart nginx, does it work
    Code (Text):
    server {
     server_name 3alamtaney.com www.3alamtaney.com;
     return 301 https://www.$server_name$request_uri;
    }
    server {
      listen 443 ssl http2;
      server_name 3alamtaney.com;
      return 301 https://www.3alamtaney.com$request_uri;
      ssl_dhparam /usr/local/nginx/conf/ssl/3alamtaney.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/3alamtaney.com/3alamtaney.com-acme.cer;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/3alamtaney.com/3alamtaney.com-acme.key;
      include /usr/local/nginx/conf/ssl_include.conf;
    }               
    

    if it does, then you have non-HTTPS to HTTPS redirect enabled at Cloudflare level so do not need the nginx redirects or you can enable nginx redirects but disable Cloudflare level redirects
     
  14. gamal

    gamal Member

    99
    8
    8
    Jan 31, 2018
    Ratings:
    +11
    Local Time:
    10:31 PM
    1.13.8
    yes when i disaple the mentioned code it works, but with posts its the same i have to hit enter on posts for the posts to show
     
  15. eva2000

    eva2000 Administrator Staff Member

    55,229
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    10:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Hit enter where ? If you change back to previous working permalinks originally configured, does it work ? I'd change it back for now until you figure it out as I don't have any experience with non-English issues so probably best if you make a copy of your live wordpress site on a test VPS and then you can privately test/troubleshoot permalink changes while keeping live site working.

    Also ask on Wordpress forums at
     
  16. gamal

    gamal Member

    99
    8
    8
    Jan 31, 2018
    Ratings:
    +11
    Local Time:
    10:31 PM
    1.13.8
    i renistalled the website from a backup. now its working
     
  17. eva2000

    eva2000 Administrator Staff Member

    55,229
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    10:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    So problem was with your configuration somehow ? If you backed up the old copy, you can compare the two to see what was different.