mod_rewrite to nginx

Discussion in 'Nginx' started by web@master24, Jun 21, 2010.

  1. #1
    Hi, somebody can help me to convert this:

    RewriteEngine On
    RewriteRule ^thumb-(.*)\.jpg$ thumb.php?id=$1 [L]
    RewriteRule ^image-(.*)\.jpg$ image.php?id=$1 [L]
    RewriteRule ^image-(.*)\.gif$ image.php?id=$1&gif [L]
    RewriteRule ^share-(.*)\.html$ share.php?id=$1 [L]
    RewriteRule ^gallery-(.*)-(.*)-(.*)\.html$ gallery.php?id=$2&page=$3 [L]
    RewriteRule ^gallery-(.*)-(.*)\.html$ gallery.php?id=$2 [L]
    RewriteRule ^archive-(.*)\.html$ archive.php?page=$1 [L]
    RewriteRule ^galleries-(.*)\.html$ archive.php?page=$1 [L]
    RewriteRule ^content-(.*)\.html$ content.php?$1 [L]
    RewriteRule ^profile-(.*)\.html$ profile.php?id=$1 [L]
    RewriteRule ^images-(.*)\.html$ images.php?date=$1 [L]



    to nginx please?
     
    web@master24, Jun 21, 2010 IP
  2. aroel

    aroel Well-Known Member

    Messages:
    154
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    125
    #2
    hi, you can try the following:

     
    aroel, Jun 24, 2010 IP
  3. web@master24

    web@master24 Active Member

    Messages:
    418
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    90
    #3
    thank you aroel, only one question, where i have to put this? in the htaccess or in the nginx.conf file in the vhost?
     
    web@master24, Jun 24, 2010 IP
  4. web@master24

    web@master24 Active Member

    Messages:
    418
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    90
    #4

    thanks, that works very good i put in the file vhost.conf, thank you very much
     
    web@master24, Jun 24, 2010 IP
  5. aroel

    aroel Well-Known Member

    Messages:
    154
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    125
    #5
    glad to help :D
    and yeah, you can place it in your vhost conf
     
    aroel, Jun 24, 2010 IP