Rewrite rules not working for CakePHP on IIS

前端 未结 2 1527
萌比男神i
萌比男神i 2021-01-16 11:39

I have been trying to get rewrite rules to work on IIS for CakePHP using the following web.config settings which is in the root folder:



        
2条回答
  •  独厮守ぢ
    2021-01-16 12:20

    IIS7 does not natively support .htaccess files. While there are add-ons that can add this support, you can also import htaccess rules into IIS to use CakePHP’s native rewrites. To do this, follow these steps:

    1.Use Microsoft’s Web Platform Installer to install the URL Rewrite Module 2.0 or download it directly (32-bit / 64-bit).

    2.Create a new file in your CakePHP root folder, called web.config.

    3.Using Notepad or any XML-safe editor and copy the following code into your new web.config file...

    
    
        
            
                
                
                
                
                
                
                
                
    
                            
                
                
                
                
                  
                  
                
                
                  
                  
                
                
                  
                  
    
                            
                  
                  
                
                
            
        
    
    

提交回复
热议问题