2016-11-28 54 views
1

我试着查找一个规定说:“如果URL中的index.html一部分,那么什么都不做”重写规则(如有的index.html什么都不做)对的.htaccess

路线

本地主机/休息/令牌< == Symfony的REST后端

本地主机/ index.html中/仪表板< == AngularjS前端

htaccess的

DirectoryIndex app.php 

    <IfModule mod_php5.c> 
     php_value memory_limit 1024M 
     php_value max_execution_time 600 
    </IfModule> 

    <IfModule mod_rewrite.c> 
     RewriteEngine On 

     RewriteCond %{REQUEST_URI} !^admin 

     RewriteCond %{HTTP:Authorization} ^(.*) 
     RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] 

     RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 
     RewriteRule ^(.*) - [E=BASE:%1] 

     RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
     RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] 

     RewriteCond %{REQUEST_FILENAME} -f 
     RewriteRule .? - [L] 

     RewriteRule .? %{ENV:BASE}/app.php [L] 


    </IfModule> 

    <IfModule !mod_rewrite.c> 
     <IfModule mod_alias.c> 
      RedirectMatch 302 ^/$ /app.php/ 
     </IfModule> 
    </IfModule> 

回答

2

在你的htaccess的顶部,把下面的

RewriteEngine on 

RewriteRule index\.html - [L] 

这将从所有的RewriteRules排除的index.html。