0

I need hide frontend/web in iis:
My actually url yii/frontend/url and need hide this part.

I have pretty url in frontend/web/web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

 <system.webServer>

   <httpProtocol>
     <customHeaders>
       <add name="Access-Control-Allow-Origin" value="*" />
     </customHeaders>
   </httpProtocol>
  <directoryBrowse enabled="false" />

  <rewrite>
   <rules>
   <rule name="Hide Yii Index" stopProcessing="true">
    <match url="." ignoreCase="false" />
    <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
    </conditions>
     <action type="Rewrite" url="index.php" appendQueryString="true" />
   </rule> 
   </rules>
  </rewrite>
        <handlers>
                <remove name="OPTIONSVerbHandler" />
                <add name="OPTIONSVerbHandler" path="*" verb="OPTIONS" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="bitness32" />
            </handlers>

     </system.webServer> 
    </configuration>

If I apply in yii
$baseUrl = str_replace('/frontend/web', '', (new Request)->getBaseUrl());
this delete frontend/web and the url is yii/controller/action this is correct, I want this url, but iis return a config error.
what I can do?
Thanks.

IStranger
  • 1,360
  • 11
  • 17
metola
  • 59
  • 3

0 Answers0