-1
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
        <rules>
            <rule name="rule 1e" stopProcessing="true">
                <match url="^Assets/(.*)$"  />
                <action type="Rewrite" url="/php/Assets/{R:1}"  />
            </rule>
             <rule name="Imported Rule 0" stopProcessing="true">
                <match url="^(.*)$"  ignoreCase="true" />
                <action type="Rewrite" url="/php/index.php?url={R:1}" appendQueryString="true" />
            </rule>

        </rules>
        </rewrite>
    </system.webServer>
</configuration>

How can i convert it into .htaccess ? I searched for a converter but there's no one

Xhust
  • 1
  • 3
  • How did none of [the existing questions](https://www.google.de/search?q=site:stackoverflow.com+web.config+to+.htaccess+conversion) help you? – mario Aug 29 '16 at 14:37
  • 1
    Possible duplicate of [Convert .htaccess to web.config](http://stackoverflow.com/questions/25365508/convert-htaccess-to-web-config) – micstr Aug 29 '16 at 14:47

1 Answers1

1

You can do it manually.

  • Create a .htaccess text file.
  • Craft a RewriteRule for each <rule> set.
  • The url="^...*$" regexp remains as match pattern.
  • Whereas the <action url=...> becomes the rewrite target.
    • A {R:1} would become $1 in the target,
    • a {R:2} likewise $2 and so on.
  • <rule> flags like stopProcessing are written as [L] in Apache rules. And ignoreCase becomes [NC] for instance. (See the manual for further flags.)

For example:

  #                     <action url=>
  #                          ↓ 
  RewriteRule ^...*$  /path.php?param=$1  [NC,L]
  #             ↑                            ↑
  #        <match url=>                    flags
mario
  • 144,265
  • 20
  • 237
  • 291
  • i tryed but it doesn't work, is something wrong ? RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^Assets/(.*)$ /php/Assets/$1 [NC] RewriteRule ^(.*)$ /php/index.php?url=$1 [L,NC] – Xhust Aug 29 '16 at 15:56
  • There's an [edit link](http://stackoverflow.com/posts/39208757/edit) for your question. Neither the `` wrapping nor `RewriteCond` are sensible. And "doesn't work" is not a problem description. Log entries and RewriteLog are. – mario Aug 29 '16 at 16:20