• 23-04-2016, 14:53:40
    #1
    Merhabalar fiziksel centos 6.7 64bit sunucuma Panilux panel kurdum üzerinde ssl ile birlikte PrestaShop ve Wordpress kullanıyorum. Nginx apache den performanslı geldiği için Nginx kullanıyorum ancak iki gündür araştırmama rağmen .htaccess dosyasini calistiramadim yani hem prestashop da hemde wordpress de seo uyumlu url kullanmak istiyorum ancak yapamadım

    PrestaShop da kullandığım .htaccess şu şekildedir https:// www. siteadresi .com şeklindedir adres
    # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
    # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
    # http://www.prestashop.com - http://www.prestashop.com/forums
    
    <IfModule mod_rewrite.c>
    <IfModule mod_env.c>
    SetEnv HTTP_MOD_REWRITE On
    </IfModule>
    
    RewriteEngine on
    RewriteRule . - [E=REWRITEBASE:/]
    RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
    
    # Images
    RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
    RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
    RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
    RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
    RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
    # AlphaImageLoader for IE and fancybox
    RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
    
    # Dispatcher
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
    </IfModule>
    
    AddType application/vnd.ms-fontobject .eot
    AddType font/ttf .ttf
    AddType font/otf .otf
    AddType application/x-font-woff .woff
    
    #If rewrite mod isn't enabled
    ErrorDocument 404 /index.php?controller=404
    
    # ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

    wordpress de kullandığım .htaccess dosyası ise şu şekildedir https:// blog. siteadresi .com şeklindedir adres

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^(.*) http://blog.indirimonline.com/$1 [R=301,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    bu konuda yardımlarınızı rica ediyorum kimisi nginx.conf dosyasidnan ayar yapiliyor felan yazmis ama nasil yapiliyor çözemedim paniliux de

    yardımlarınız için şimdiden teşekkür ederim..
  • 26-04-2016, 12:05:51
    #2
    güncel
  • 26-04-2016, 12:44:24
    #3
    Prestashop için

    rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
    rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$1$2$3.jpg last;
    rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
    rewrite ^/c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.jpg$ /img/c/$1$2$3.jpg last;
    rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+.jpg$ /img/c/$1$2.jpg last;
    rewrite ^/images_ie/?([^/]+).(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last;
    try_files $uri $uri/ /index.php;
    error_page 404 /index.php?controller=404;
    Wordpress için

    try_files $uri $uri/ /index.php?$args;
  • 26-04-2016, 15:45:15
    #4
    victories adlı üyeden alıntı: mesajı görüntüle
    Prestashop için

    rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
    rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$1$2$3.jpg last;
    rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
    rewrite ^/c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.jpg$ /img/c/$1$2$3.jpg last;
    rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+.jpg$ /img/c/$1$2.jpg last;
    rewrite ^/images_ie/?([^/]+).(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last;
    try_files $uri $uri/ /index.php;
    error_page 404 /index.php?controller=404;
    Wordpress için

    try_files $uri $uri/ /index.php?$args;

    çok sağolun bu kodlari .htaccess icerigini silip bunlarimi yapistiriyoruz yoksa nginx.conf a mi ekliyorz
  • 26-04-2016, 16:57:18
    #5
    nginx.conf ta server bloğuna eklemelisiniz.
  • 26-04-2016, 17:35:40
    #6
    victories adlı üyeden alıntı: mesajı görüntüle
    nginx.conf ta server bloğuna eklemelisiniz.
    denedim fakat 404 sayfası cikiyor bu seferde uzak masaüstü versem veya panel sifresini bakabilirmisiniz
  • 27-04-2016, 10:09:56
    #7
    Panilux Panel'de çalışan PrestaShop için Nginix ayarları aşağıdaki gibidir.
    panilux panelde domain sekmesinde rewrite ayarları kısmından bu kodlar eklenebileceği gibi winscp üzerinde /sites/nginx-confs/siteadresi.com.rewrites dosyasi üzerinden de değişiklikler yapilabilir

    charset utf-8;
        client_max_body_size 200M;
    
    
        ######################################################
        ##  MultiSite Support
        ##   WORLD SITES
        ##  For Google optimisation reasons, this customer has a .co.uk domain for UK customers
        ##  and a .com for global visitors
        ##  the .com url will be in the following format:
        ##  NOTE:  This is a multisite url NOT a prestashop language URL
        ##  www.myshop.com/us   (USA)
        ##  www.myshop.com/fr   (France)
        ##  www.myshop.com/ca   (canada)
        ##  etc.  These URLs are then registered as country specific in Google Webmaster Tools.
        ##  NEXT:  if  multilingual is also required
        ##  the url format is:
        ##  www.myshop.com/ca/fr
        ##  www.myshop.com/ca/en
        ##  etc.
        #######################################################
        ##  only rewrite for a given domain
        ##  this could be moved to the server definition file instead of here...
        ##  however I have placed it here to save having two different
        ##  server definitions
        ##  
        if ($http_host ~ "^www.indirimonline.com$") {
            rewrite '^/([a-zA-Z]{2})$'     /$1/ redirect;
            rewrite '^/([a-zA-Z]{2})/(.*)'     /$2;
        }
    
        rewrite ^/api$ /api/ last;
        ##  ALL IMAGES REWRITE
        rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$                 /img/p/$1/$1$2$3.jpg last;
        rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$          /img/p/$1/$2/$1$2$3$4.jpg last;
        rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$   /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
        rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$            /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
        rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$     /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
        rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$          /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
        rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$   /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
        rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$    /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
    
        rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$   /img/c/$1$2.jpg last;
        rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+.jpg$                 /img/c/$1.jpg last;
        rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$     /img/c/$1$2.jpg last;
    
        rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$              /js/jquery/plugins/fancybox/images/$1.$2 last;
    
    
        rewrite '^/order/step([0-9]).html$'      /index.php?controller=order&step=$2   last;
        rewrite '^/quick-order$'                 /index.php?controller=order-opc       last;
        rewrite '^/password-recovery$'           /index.php?controller=password        last;
    
    
        if (!-e $request_filename){
            rewrite ^(.*)$ /index.php?q=$1 last;
        }
    
        location /api { 
            rewrite ^/api/(.*)$ /webservice/dispatcher.php?url=$1 break; 
        }
    
        # Do not log robots.txt or favicon.ico file requests
        location ~* ^/(favicon.ico|robots.txt)$ {
            access_log off;
            log_not_found off;
        }
    
        # Custom Prestashop 404 page
        error_page 404 /index.php?controller=404;
    
        #  Set long expirey values for CSS and Images (assuming you dont change them too often)
        location ~* ^.+.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css|mp3|swf|ico|flv|xml) {
            access_log off;
            expires 30d;
        }
    Kaynak



    Panilux Panel'de çalışan Sub Domain Wordpress için Nginix ayarları aşağıdaki gibidir.
    panilux panelde domain sekmesinde rewrite ayarları kısmından bu kodlar eklenebileceği gibi winscp üzerinde /sites/nginx-confs/siteadresi.com.rewrites dosyasi üzerinden de değişiklikler yapilabilir

    if (!-e $request_filename) {
    	rewrite . /index.php last;
    }





    @victories arkadaşıma yol gösterici olduğu için teşekkür ederim
  • 27-04-2016, 10:26:53
    #8
    Bir tek şu kısmı,
    Alıntı
    if (!-e $request_filename){
    rewrite ^(.*)$ /index.php?q=$1 last;
    }
    aşağıdaki gibi değiştirmeni tavsiye ederim, nginxte çok gerekmedikçe if kullanma
    Alıntı
    try_files $uri $uri/ /index.php?q=$uri;
    https://www.nginx.com/resources/wiki...epth/ifisevil/
    https://www.nginx.com/resources/wiki...alls/#using-if


    Ayrıca şu kısmı anlayamadım tam,

    Alıntı
    if ($http_host ~ "^www.indirimonline.com$") {
    rewrite '^/([a-zA-Z]{2})$' /$1/ redirect;
    rewrite '^/([a-zA-Z]{2})/(.*)' /$2;
    }
    birden fazla dil var sitede bu dilleri mi yönlendiriyorsun?
  • 27-04-2016, 10:29:00
    #9
    victories adlı üyeden alıntı: mesajı görüntüle
    Bir tek şu kısmı,


    aşağıdaki gibi değiştirmeni tavsiye ederim, nginxte çok gerekmedikçe if kullanma


    https://www.nginx.com/resources/wiki...epth/ifisevil/
    https://www.nginx.com/resources/wiki...alls/#using-if


    Ayrıca şu kısmı anlayamadım tam,

    birden fazla dil var sitede bu dilleri mi yönlendiriyorsun?
    birden fazla dil yok deneme yanilma buldugum bütün kodları denedim bunlar çalıştı if kullanmanın zararları nedir sizin verdiğini wordpress kodu calışmadı presta kodu ise 404 verdi