2016-10-16 4 views
0

У меня есть URL-адрес «/ цитата/подробности/e4dd5f4e4c705436ba381b0dc06fccc0», который переписывает для: «?/Цитата/подробности/retrieveQuote = e4dd5f4e4c705436ba381b0dc06fccc0»IIS Переписать URL дважды?

<rule name="Rewrite Saved Quote to Query String Type" stopProcessing="false"> 
    <match url="^quote/details/([^/]+)/?$" /> 
    <conditions> 
     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
     <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
    </conditions> 
    <action type="Rewrite" url="quote/details/?retrieveQuote={R:1}" appendQueryString="true" /> 
</rule> 

Это работает, потому что, когда я поставил stopProcessing истина я получаю 404 с правильный выход: Запрошенный URL цитаты/подробности/retrieveQuote = e4dd5f4e4c705436ba381b0dc06fccc0

Это должно теперь быть переписано как остальная часть сайта с помощью этого:

<rule name="Rewrite to Index" patternSyntax="Wildcard" stopProcessing="true"> 
    <match url="*" /> 
    <conditions> 
     <add input="{URL}" pattern="/admin/+" ignoreCase="false" negate="true" /> 
     <add input="{URL}" pattern="/api/+" ignoreCase="false" negate="true" /> 
     <add matchType="IsFile" negate="true" /> 
     <add matchType="IsDirectory" negate="true" /> 
    </conditions> 
    <action type="Rewrite" url="index.php" appendQueryString="true" /> 
</rule> 

Но по какой-то причине он не и если я использую $ _SERVER [ «REQUEST_URI»] он печатает: цитата/подробности/e4dd5f4e4c705436ba381b0dc06fccc0 но должно быть: цитата/подробности/retrieveQuote = e4dd5f4e4c705436ba381b0dc06fccc0

Любые идеи, как получить? он работает правильно?

ответ

0

Не удалось найти решение этого вопроса, поэтому я создал правило маршрутизации и разделил требуемый параметр с URL-адреса.