PHP, URL rewriting with htaccess, and Microsoft IIS Url Rewriting

后端 未结 4 1417
一个人的身影
一个人的身影 2021-01-01 03:04

I am used to working with Apache servers, so when mod_rewrite is enabled, I can create an htaccess file and use URL rewriting.

Here\'s my htaccess file:



        
4条回答
  •  伪装坚强ぢ
    2021-01-01 03:20

    If you use IIS 7 then you can use IIS URL Rewrite Module, that has an "Import Rules" feature that can be used to translate mod_rewrite rules to IIS URL rewrite format. These particular rewrite rules will not translate because the RewriteCond uses the "-s" and "-l" flags which check if the requested URL corresponds to a non-zero size file or to a symbolic link on a file system. If your application does not use any symbolic links then you can safely replace these conditions with:

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    

    and then convert the rules by using IIS URL Rewrite UI. That will result in these rules:

    
      
        
          
          
            
            
          
          
        
        
          
          
        
      
    
    

提交回复
热议问题