wordpress IIRF伪静态规则

将以下规则保存为iirf.ini放到网站根目录即可实现伪静态。
RewriteBase /

#store original URL in custom header (substitute for missing REQUEST_URI header in IIS)
RewriteHeader X-REWRITE-URL: ^$ %{REQUEST_URI}

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

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

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

Leave a Reply

Your email address will not be published.