.html 및 .php 확장자를 어떻게 삭제합니까?

2020. 7. 15. 20:40it 개발

    목차

IIS는 Windows에서 사용되는 편리한 웹 서버입니다.

web.config를 설정하여 보안 구성을 설정하겠습니다

* 경고!
url rewite 2.0을 다운로드해야합니다
https://www.magsty.net/2020/07/how-i-download-iis-url-rewite-20.html




1. .html 확장자 삭제

 

<rule name="html redirection" stopProcessing="true">

     <match url="^(.*).html$" />

               <conditions>

                    <add input="{URL}" pattern="(.*).html$" />

               </conditions>

     <action type="Redirect" url="{R:1}" />

</rule>


웹 사이트의 web.config에서이 코드를 Ctrl + c와 Ctrl + v로
이 옵션은 .html 삭제 리디렉션입니다. 예를 보여 드리겠습니다.
전의)
https://magsty.net/index.html-> https://magsty.net/index

이 코드는 .php 또는 .jsp와 같은 다른 확장자에 사용할 수 있습니다

2. .php 확장자 삭제

<rule name="html redirection" stopProcessing="true">
      <match url="^(.*).php$" />
               <conditions>
                    <add input="{URL}" pattern="(.*).php$" />
               </conditions>
     <action type="Redirect" url="{R:1}" />
</rule>


웹 사이트의 web.config에서이 코드를 Ctrl + c와 Ctrl + v로
이 옵션은 .html 삭제 리디렉션입니다. 예를 보여 드리겠습니다.
전의)
https://magsty.net/index.php-> https://magsty.net/index


3..jsp 확장명 삭제

<rule name="html redirection" stopProcessing="true">
      <match url="^(.*).jsp$" />
               <conditions>
                    <add input="{URL}" pattern="(.*).jsp$" />
               </conditions>
     <action type="Redirect" url="{R:1}" />
</rule>


웹 사이트의 web.config에서이 코드를 Ctrl + c와 Ctrl + v로
이 옵션은 .html 삭제 리디렉션입니다. 예를 보여 드리겠습니다.
전의)
https://magsty.net/index.jsp-> https://magsty.net/index


요청 또는 질문을 다시 작성하기 위해 쉼표를 시청하고 작성해 주셔서 감사합니다.