Learn about Centmin Mod LEMP Stack 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:
    10:06 PM
    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

    40,633
    9,019
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,887
    Local Time:
    10:06 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  3. DenSouLew

    DenSouLew New Member

    6
    1
    3
    May 27, 2015
    Ratings:
    +1
    Local Time:
    10:06 PM
    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
     
    style="display:inline-block;min-width:400px;max-width:970px;width:95%;height:90px" data-ad-client="ca-pub-6669518204467592" data-ad-slot="4024536743" data-ad-format="auto">
  4. eva2000

    eva2000 Administrator Staff Member

    40,633
    9,019
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,887
    Local Time:
    10:06 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    maybe
    Code:
    try_files $uri $uri/ /index.php?p=$uri&$args;