Skip to content

Instantly share code, notes, and snippets.

@amin007
Created January 1, 2020 01:07
Show Gist options
  • Save amin007/b52c81d65c571de865bcb4543204ffdd to your computer and use it in GitHub Desktop.
Save amin007/b52c81d65c571de865bcb4543204ffdd to your computer and use it in GitHub Desktop.
tukar .htaccess kepada web.config daa
<?php
/*
# https://cbsa.com.br/tools/online-convert-htaccess-to-web-config.aspx
#--------------------------------------------------------------------------------------------------
# dalam apache guna laragon
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
#--------------------------------------------------------------------------------------------------
# standard
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rule name="rule 1L" stopProcessing="true">
<match url="^(.+)$" />
<action type="Rewrite" url="/index.php?url={R:1}" appendQueryString="true" />
</rule>
</rewrite>
</system.webServer>
</configuration>
#--------------------------------------------------------------------------------------------------
# wordpress
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
#--------------------------------------------------------------------------------------------------
# magento
<rule name="Imported Rule 1" stopProcessing="true">
<match url=".*" ignoreCase="false" />
<conditions>
<add input="{URL}" pattern="^/(media|skin|js)/" ignoreCase="false" negate="true" />
<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" />
</rule>
#--------------------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment