2010-05-19 81 views
2
RewriteEngine On 
RewriteBase BASE/ 

#uploaded files 
RewriteRule ^(.*/)?files/$ index.php [L] 
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* 
RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L] 

# add a trailing slash to /wp-admin 
RewriteCond %{REQUEST_URI} ^.*/wp-admin$ 
RewriteRule ^(.+)$ $1/ [R=301,L] 

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule . - [L] 
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] 
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] 
RewriteRule . index.php [L] 

Nginx的外觀如何?Wordpress 3.0將.htaccess轉換爲nginx重寫規則

非常感謝你,

Eiso

回答

1

你應該嘗試在配置文件中。對於我這種工作:

location/{ 
     index index.html index.php; 
     # URLs that don't exist go to WordPress /index.php PHP FastCGI 
     if (!-e $request_filename) { 
      rewrite ^.* /index.php break; 
      fastcgi_pass 127.0.0.1:9001; 
     } 

http://www.farinspace.com/wordpress-nginx-rewrite-rules/