wordpress在nginx和apache环境伪静态配置规则

nginx规则:

location / {
	index index.html index.php; 
	if (-f $request_filename/index.html){ 
		rewrite (.*) $1/index.html break; 
	} 
	if (-f $request_filename/index.php){ 
		rewrite (.*) $1/index.php; 
	} 
	if (!-f $request_filename){ 
		rewrite (.*) /index.php; 
	} 
} 

或者

location /
{
	 try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

apache规则:



RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

IIS7.5配置web.config



  
    
      
                
                    
                    
                    
                
                
                    
                    
                    
                
                
                    
                    
                        
                        
                    
                    
                
                
                    
                    
                        
                        
                    
                    
                
    
  

在wordpress后台设置==>固定链接==>自定义结构==>输入/%post_id%.html

© 版权声明
THE END
喜欢就支持一下吧
点赞0赞赏 分享
评论 共6条

请登录后发表评论

    暂无评论内容