.htaccess di ngix gak bisa kepake?

Discussion in 'Web Hosting' started by Mylo Sepz, 15 Sep 2012.

Thread Status:
Not open for further replies.
  1. Mylo Sepz

    Mylo Sepz Apprentice 2.0

    Messages:
    532
    Likes Received:
    59
    Trophy Points:
    28
    pagi semua saya baru saja install ngix + php + mysql dan masukan script forum yang ada .htaccessnya tapi pas dibuka sub forumnya malah not found.

    ini htaccess asli
    Code:
    <IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule . /public/404.php [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    ini .htaccess versi 1
    Code:
    if ($request_filename ~ ".*.(jpeg|jpg|gif|png)$"){
    	set $rule_0 1$rule_0;
    }
    if (!-f $request_filename){
    	set $rule_0 2$rule_0;
    }
    if ($rule_0 = "21"){
    	rewrite /. /public/404.php last;
    }
    if (!-f $request_filename){
    	set $rule_1 1$rule_1;
    }
    if (!-d $request_filename){
    	set $rule_1 2$rule_1;
    }
    if ($rule_1 = "21"){
    	rewrite /. /index.php last;
    }
    
    ini .htaccess versi 2
    Code:
    location / { 
      if ($request_filename ~ .*\.(jpeg|jpg|gif|png)$){ 
        rewrite ^(.*)$ /public/404.php break;
      }
      if (!-e $request_filename){
        rewrite ^(.*)$ /index.php break; 
      } 
    }
    dan saya bingung ini semua pas dipake sebagai .htaccess gak ngaruh. dan saya bingung ini di taruh di .conf apa di .htaccess?
     
  2. mustafaramadhan

    mustafaramadhan Hosting Guru

    Messages:
    3,237
    Likes Received:
    857
    Trophy Points:
    113
    Nginx (pure) tidak bisa baca .htaccess. Itu salahsatu sebab adanya nginx-proxy (nginx di front-end dan apache di back-end) dimana adalah tugas apache memproses php dan juga membaca .htaccess.
     
  3. Mylo Sepz

    Mylo Sepz Apprentice 2.0

    Messages:
    532
    Likes Received:
    59
    Trophy Points:
    28
    terus supaya bisa baca .htaccess gimana mas? harus install apa? adakah refrensinya? :(
     
  4. BolaNaga

    BolaNaga Apprentice 1.0

    Messages:
    448
    Likes Received:
    45
    Trophy Points:
    28
    .htaccess hanya akan bekerja maksimal di full apache, bukan IIS,bukan nginx dan bukan pula varnish :D
     
  5. Doel

    Doel Beginner 2.0

    Messages:
    72
    Likes Received:
    26
    Trophy Points:
    18
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...