Remove index.php of Codeigniter on IIS?

前端 未结 2 1382
忘掉有多难
忘掉有多难 2021-02-04 16:42

I understand I can remove the \'index.php\' part of the url with the following web.config code:


  
    

        
2条回答
  •  猫巷女王i
    2021-02-04 17:13

    I have WordPress in the root directory and my CodeIgniter application in a sub-directory. I create a similar web.config like yours and save it in the sub-directory. My CI app doesn't need the index.php in url any more.

    At first, I add my sub-directory in the and wish it could be restricted to look into the sub-directory only but fails. I remove the sub-directory and leave it to original but move the web.config to the subdirectory and it works.

    Therefore, I think maybe you may create two web.config files with different rules and saves them in different directory.

    Another note might help: enable the error message to output the detail from IIS. I use the tricks to find out how IIS looks for my files. It is , , and the section as below:

    
    
    
        
    
            
            
    
            
            
                
                    
                    
                        
                        
                    
                    
                
            
            
    
        
    
        
            
            
        
    
    
    

    Wish it help!

提交回复
热议问题