Welcome to Centmin Mod Community
Become a Member

Nginx htaccess to nginx conversion?

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

Tags:
  1. tdubs

    tdubs Member

    84
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    4:31 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

    54,110
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,739
    Local Time:
    4:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    84
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    4:31 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

    54,110
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,739
    Local Time:
    4:31 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+