Learn about Centmin Mod LEMP Stack today
Register Now

Nginx htaccess to nginx conversion?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by tdubs, May 21, 2015.

Tags:
  1. tdubs

    tdubs Member

    83
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    1:54 PM
    1.7.12
    10.0.17
    Hello,

    Whenever I visit the URL http://domain.com/staff/core.staffDetails I am sent to a Cloudflare 404 simply because my panel which uses those URL types are ran from a .htaccess. Below is my .htaccess which hopefully will allow all of my pages to function properly. I'm not good with Nginx as I'm still learning, but I assume the conversion will go into my nginx.conf file? If so, can someone convert this?

    Code:
    Options -Indexes
    
    # Various rewrite rules.
    <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} !=/favicon.ico
    
      RewriteRule ^(.*)(\.)(.*)$ index.php?url=$1.$3 [L,QSA]
      RewriteRule ^ajax$ _res/ajax.php [QSA]
      #RewriteRule ^(.*)$ index.php?t=$1 [L,QSA]
    </IfModule>
    Thanks!
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    1:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    trial and error testing and maybe htaccess to nginx converter

    also google your web app for nginx rewrite rules, there maybe examples as well

    tried asking web app's developer ?

    nginx rewrites go into your domain's nginx vhost file
     
    Last edited: May 21, 2015
  3. tdubs

    tdubs Member

    83
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    1:54 PM
    1.7.12
    10.0.17
    I get this whenever I put it in my vhost.conf and//or domain.com.conf file.

    [​IMG]

    Converter gives me:
    Code:
    # nginx configuration location = /favicon.ico {
    } autoindex off;
    location / {
    if (!-e $request_filename){
    rewrite ^/(.*)(\.)(.*)$ /index.php?url=$1.$3 break;
    }
    }
    location = /ajax {
    rewrite ^(.*)$ /_res/ajax.php;
    }
    Also, the panel I'm using is no longer offering support from the web developer's.
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    1:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1