Join the community today
Register Now

Nginx Nginx Rewrite Rules

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

Tags:
  1. DenSouLew

    DenSouLew New Member

    6
    1
    3
    May 27, 2015
    Ratings:
    +1
    Local Time:
    9:05 AM
    1.9.1
    MariaDB 10.0.19
    Hey everyone,

    Im trying some hours now to figure out how to modify the current htaccess so i can use it with Nginx. Its custom script so i havent found any nginx rules...


    Code:
    Options -Indexes +FollowSymLinks
    
    
    <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} -f [OR]
            RewriteCond %{REQUEST_FILENAME} -l [OR]
            RewriteCond %{REQUEST_FILENAME} -d
            RewriteRule ^.*$ - [NC,L]
            RewriteRule ^(ajax/|data/|js/|styles/|favicon\.ico|robots\.txt) - [NC,L]
            RewriteRule ^.*$ index.php?p=notfound [NC,L]
    </IfModule>

    Ive tried also the htaccess to nginx converter but it doesnt show me any suggestions for
    Code:
            RewriteCond %{REQUEST_FILENAME} -f [OR]
            RewriteCond %{REQUEST_FILENAME} -l [OR]
            RewriteCond %{REQUEST_FILENAME} -d
            RewriteRule ^.*$ - [NC,L]

    Any help would be really appreciated. Thanks again guys :)
     
  2. eva2000

    eva2000 Administrator Staff Member

    49,890
    11,489
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,848
    Local Time:
    9:05 AM
    Nginx 1.21.x
    MariaDB 10.x
  3. DenSouLew

    DenSouLew New Member

    6
    1
    3
    May 27, 2015
    Ratings:
    +1
    Local Time:
    9:05 AM
    1.9.1
    MariaDB 10.0.19
    Ive tried it with no results :(

    If someone else can help the url is like that
    Code:
    domain.com/?p=forums&pid=11
     
  4. eva2000

    eva2000 Administrator Staff Member

    49,890
    11,489
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,848
    Local Time:
    9:05 AM
    Nginx 1.21.x
    MariaDB 10.x
    maybe
    Code:
    try_files $uri $uri/ /index.php?p=$uri&$args;