Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to convert this .htaccess to Nginx format, please guide me if you can.

DirectoryIndex index.php

FileETag none
ServerSignature Off

Options All -Indexes

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteRule ^([0-9a-zA-Z]{1,6})$ links/?to=$1 [L]

RewriteRule ^([0-9]{1,9})/banner/(.*)$ links/?uid=$1&adt=2&url=$2 [L]

RewriteRule ^([0-9]{1,9})/(.*)$ links/?uid=$1&adt=1&url=$2 [L]

</IfModule>

thanks again...

share|improve this question
up vote 1 down vote accepted

Try this,

rewrite ^/([0-9a-zA-Z]{1,6})$ /links/?to=$1 last;
rewrite ^/([0-9]{1,9})/banner/(.*)$ /links/?uid=$1&adt=2&url=$2 last;
rewrite ^/([0-9]{1,9})/(.*)$ /links/?uid=$1&adt=1&url=$2 last;

Source: http://www.anilcetin.com/convert-apache-htaccess-to-nginx/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.