Apache 将nginx conf转换为.htaccess文件

Apache 将nginx conf转换为.htaccess文件,apache,.htaccess,yii2-advanced-app,nginx-config,Apache,.htaccess,Yii2 Advanced App,Nginx Config,我已经在Apache服务器中设置了现有的Yi2高级项目。在它出现在nginx服务器上之前。我有一个nginx.conf文件。我想转换它的.htaccess文件,使项目也能在Apache服务器上工作 以下是nginx.conf文件代码 location / { index index.php index.html; try_files $uri $uri/ /index.php?$args; } # / location location /html { alias

我已经在Apache服务器中设置了现有的Yi2高级项目。在它出现在nginx服务器上之前。我有一个nginx.conf文件。我想转换它的.htaccess文件,使项目也能在Apache服务器上工作

以下是nginx.conf文件代码

location / {
     index index.php index.html;
     try_files $uri $uri/ /index.php?$args;
} # / location

location /html {
    alias /../../html/;
}
location /api {
    if ( !-e $request_filename ) {
            rewrite ^/api/(.*)$ /api/index.php?$1 last;
    }
}
location /dten {
    if ( !-e $request_filename ) {
            rewrite ^/dten/(.*)$ /dten/index.php?$1 last;
    }
}
location /dten-backend {
    if ( !-e $request_filename ) {
            rewrite ^/dten-backend/(.*)$ /dten-backend/index.php?$1 last;
    }
} 
location /dten-crm {
    if ( !-e $request_filename ) {
        rewrite ^/dten-crm/(.*)$ /dten-crm/index.php?$1 last;
    }
}
我试过这个,但不起作用

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule / index.php


# Handle the case of backend, skip ([S=1]) the following rule, if current matcheds
RewriteRule ^/dten-backend(/(.*))?$ /dten-backend/$2 [S=1]