Convert web.config to .htaccess


I would like to convert this web.config

<rule name="cambiarPass" stopProcessing="true">
<match url="^cambiarPass/" />
<action type="Rewrite" url="modulos/cambiarPass/controller.php" appendQueryString="false" />

to a .htaccess Your help please. Thanks.

asked by Juan Carlos Rocafuerte 28.03.2016 в 15:41

1 answer


What you're looking for would be something like this:

RewriteCond %{REQUEST_URI} ^cambiarPass/.*$
RewriteRule ^(.*)$ modulos/cambiarPass/controller.php [L]

What it means:

  • RewriteCond %{REQUEST_URI} ^cambiarPass/ :

    This is the same condition you have: if the URL starts with "cambiarPass /"

  • RewriteRule ^(.*)$ modulos/cambiarPass/controller.php [L]

    Then change the request completely ( ^(.*)$ would be all) by the URL you want to go to (the one in controller.php).

    Also, with the flag [L] you are indicating that if this rule is fulfilled it should be the last one ( L ast) and it should no longer process more rules (equivalent to stopProcessing="true" )

answered by 30.03.2016 в 06:08