How To : Nginx Wordpress Rewrite rules (With suPHP)

Discussion in 'WordPress' started by EApubs, May 10, 2011.

  1. #1
    Im trying to take my website (A Wordpress site) from Apache to Nginx. When going to Nginx, we need to convert the htaccess rules to the Nginx config file... Can you please help me to conver this? Here is my Wordpress htaccess file : (Please note that i have Nginx with suPHP)

        RewriteEngine On
        RewriteCond %{HTTPS} on
        RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
        RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
        
        # REDIRECT to FEEDBURNER
        <IfModule mod_rewrite.c>
         RewriteCond %{REQUEST_URI} ^/feed/ [NC]
         RewriteCond %{HTTP_USER_AGENT} !(FeedBurner|FeedValidator) [NC]
         RewriteRule .* http://feeds.feedburner.com/techhamlet [L,R=302]
        
         RewriteCond %{REQUEST_URI} ^/comments/feed/ [NC]
         RewriteCond %{HTTP_USER_AGENT} !(FeedBurner|FeedValidator) [NC]
         RewriteRule .* http://feeds.feedburner.com/techhamlet/comments [L,R=302]
        </IfModule>
        
        <files wp-config.php>
        order allow,deny
        deny from all
        </files>
        
        # disable directory browsing
        Options All -Indexes
        
        RewriteEngine On
        RewriteBase /
        RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
        RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
        
        # BEGIN WordPress
        <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        RewriteRule ^index\.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.php [L]
        </IfModule>
        # END WordPress
    Code (markup):
     
    EApubs, May 10, 2011 IP
  2. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #2
    I know this is off topic but why make a change like that?
     
    adbox, May 11, 2011 IP