Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Issues with SEO URL's - Centos Web Panel CWP Abantecart  (Read 10973 times)

Offline Shaf Brady

  • Newbie
  • *
  • Posts: 8
  • Karma: +3/-0
    • View Profile
Issues with SEO URL's - Centos Web Panel CWP Abantecart
« on: July 20, 2019, 02:09:29 PM »
Hi, i am using centos web panel and i am using nginx apache varnish, i am wondering what setting of nginx i need to edit to get SEO URL's working.
The site is onlinebusiness1.com please advice as i have some other errors that are most likely related.

How, can i get abantecart CMS to work correctly? I am using Nginx apache varnish web server, should i go back to Apache only? Maybe it is just a small thing i need to do but i can not find any answers using Google search.
I migrated the website from cPanel but also having the same issue with a newly installed domain using Abantecart CMS.

onlinebusiness1.com/index.php?rt=product/category&path=74_91  When the 2 links at the bottom of the page are clicked on it goes to an error page or not found.

Using centos 7 - CWP Pro.

As far as i can tell it is not a mod security issue or htaccess issues, though i think i need to add something to nginx.conf or edit another part of the nginx configurations in CWP admin panel.

SEO URL not working on 5 sites on 3 different CWP servers so yes it is CWP related but not getting any answers on their forum.

Already posted here forum.centos-webpanel.com/centos-configuration/abantecart-seo-url-issues/

Thanks, any replies much appreciated.

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5772
  • Karma: +274/-2
    • View Profile

Offline Shaf Brady

  • Newbie
  • *
  • Posts: 8
  • Karma: +3/-0
    • View Profile
Re: Issues with SEO URL's - Centos Web Panel CWP Abantecart
« Reply #2 on: July 24, 2019, 03:49:28 PM »
Thanks for the reply, i added that file to public_html and named it nginx.conf
What a page says:

Not Found

The requested URL /logo-creation was not found on this server.

Would i need to edit the main server nginx files or maybe it is something else a different issue, been stuck on this for 1 month now.

Offline Shaf Brady

  • Newbie
  • *
  • Posts: 8
  • Karma: +3/-0
    • View Profile
Re: Issues with SEO URL's - Centos Web Panel CWP Abantecart
« Reply #3 on: July 24, 2019, 09:46:47 PM »
I fixed the error by making a .htaccess  file and just added this and nothing else:


RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]

SEO URL's are now working perfectly.

I also edited:

Contents of File: /etc/nginx/conf.d/vhosts/onlinebusiness1.com.conf

server {

        listen 80;
        server_name onlinebusiness1.com;

        access_log /usr/local/apache/domlogs/onlinebusiness1.com.log;
        error_log /usr/local/apache/domlogs/onlinebusiness1.com.error.log ;

        # root is AbanteCart's public_html directory
        root /home/onlinebu/public_html;
        index index.php index.html index.htm;

        # Prevent directory listing
        autoindex off;

        # rules applied in root of our config
        location / {

                # include AbanteCart rules
                try_files $uri $uri/ $uri.php @abantecart_rules;

                # php settings (may differ on your server)
                location ~ \.php$ {
                        #fastcgi_pass unix:/var/run/php5-fpm.sock;
                        fastcgi_pass   127.0.0.1:9001;
                        #fastcgi_index index.php;

                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                        fastcgi_param SCRIPT_NAME     $fastcgi_script_name;

                       

                        include fastcgi_params;
                }

        }

        # rewrites our query strings properly for AbanteCart
        location @abantecart_rules {
                rewrite ^(.*)\?*$ /index.php?_route_=$1 last;
        }

        # No direct access allowed for .tpl files
        location ~ \.tpl {
                deny all;
        }
        ### Abantecart Settings ###
    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }
    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
    # Make sure files with the following extensions do not get loaded by nginx because nginx would
    # display the source code, and these files can contain PASSWORDS!
    location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {
        deny all;
    }
    # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
    location ~ /\. {
        deny all;
        access_log off;
        log_not_found off;
    }
    ### Retina images handler. Check cookie and looking for file with @2x at the end of name
    location ~* ^(.*)\.(jpg|png|gif)$ {
        set $hidpi_uri $1@2x.png;
        if ($http_cookie !~ 'HTTP_IS_RETINA=1') {
          break;
        }
        try_files $hidpi_uri $uri =404;
    }

    location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
        expires max;
        log_not_found off;
    }
    location ~ /(system/logs|resources/download) {
      deny all;
      return 403;
    }
    location /admin/ {
        location ~ .*\.(php)?$ {
          deny all;
          return 403;
        }
    }
    #rewrite for images for retina-displays
    location ~ / {
        if (!-e $request_filename){
            rewrite ^/(.*)\?*$ /index.php?_route_=$1 last;
        }
    }


### End of AbanteCart settings ###

}






Make sure you leave a space after the last }

This is how i got it to work with CentosWebPanel please advise on improving this method if possible.

CWP server setup is Nginx & Apache. i renamed the nginx.conf in public_html to nginx.conf.txt or just remove it, this is just a method to get things to work and i am sure i will be editing this again soon, if i do update for improvements i will post here what i did or please advice, as CWP a lot of settings cause a not found error.
« Last Edit: July 24, 2019, 09:55:49 PM by Shaf Brady »

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5772
  • Karma: +274/-2
    • View Profile
Re: Issues with SEO URL's - Centos Web Panel CWP Abantecart
« Reply #4 on: July 25, 2019, 12:42:36 AM »
thank you for info

Offline Shaf Brady

  • Newbie
  • *
  • Posts: 8
  • Karma: +3/-0
    • View Profile
Re: Issues with SEO URL's - Centos Web Panel CWP Abantecart
« Reply #5 on: September 19, 2019, 05:28:47 PM »
Update, on another server i had an issue with SEO URL:

Menu option:
1. WebServer Settings -
2. Manage WebServers Configuration

You can manage domain configuration for webservers here.

Select a Username

(If a configuration exists delete it and SEO URL will work)

This solved SEO URL not working on a different server, something that can be easily overlooked.

Offline Shaf Brady

  • Newbie
  • *
  • Posts: 8
  • Karma: +3/-0
    • View Profile
Re: Issues with SEO URL's - Centos Web Panel CWP Abantecart
« Reply #6 on: January 31, 2020, 06:45:09 AM »
Update here is my settings:

nginx.config copy below:

### Abantecart Settings ###
    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }
    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
    # Make sure files with the following extensions do not get loaded by nginx because nginx would
    # display the source code, and these files can contain PASSWORDS!
    location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {
        deny all;
    }
    # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
    location ~ /\. {
        deny all;
        access_log off;
        log_not_found off;
    }
    ### Retina images handler. Check cookie and looking for file with @2x at the end of name
    location ~* ^(.*)\.(jpg|jpeg|png|gif)$ {
        set $hidpi_uri $1@2x.png;
        if ($http_cookie !~ 'HTTP_IS_RETINA=1') {
          break;
        }
        try_files $hidpi_uri $uri =404;
    }

    location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
        expires max;
        log_not_found off;
    }
    location ~ /(system/logs|resources/download) {
      deny all;
      return 403;
    }
    location /admin/ {
        location ~ .*\.(php)?$ {
          deny all;
          return 403;
        }
    }
    #rewrite for images for retina-displays
    location ~ / {
        if (!-e $request_filename){
            rewrite ^/(.*)\?*$ /index.php?_route_=$1 last;
        }
    }


### End of AbanteCart settings ###




.htaccess copy below:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5772
  • Karma: +274/-2
    • View Profile
Re: Issues with SEO URL's - Centos Web Panel CWP Abantecart
« Reply #7 on: February 03, 2020, 03:03:04 AM »
Many thanks, Shaf Brady

 

Powered by SMFPacks Social Login Mod