rpajak1
asked on
need help Converting web.config to .htaccess
Hello everyone...
I need help converting my web.config file into a .htaccess file.
I hope we can find some volenteers...
Here is contents of the web.config file....
Please help....
..DA for R
-------------------------- ---------- -------
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<outboundRules>
<clear />
<rule name="www.bananapages.net virtual path rewrite">
<match serverVariable="RESPONSE_L OCATION" pattern="^(https?\://www\. bananapage s\.net)/bp /(.+/)$" />
<conditions>
<add input="{RESPONSE_STATUS}" pattern="^301$" ignoreCase="false" />
</conditions>
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<rule name="bananapages.net virtual path rewrite">
<match serverVariable="RESPONSE_L OCATION" pattern="^(https?\://banan apages\.ne t)/bp/(.+/ )$" />
<conditions>
<add input="{RESPONSE_STATUS}" pattern="^301$" ignoreCase="false" />
</conditions>
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<rule name="Rewrite" preCondition="IsHTML" enabled="true" patternSyntax="Wildcard">
<match filterByTags="A, Area, Img, Input, Link, Script" pattern="*/blog/*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<rule name="rewrite2" preCondition="IsHTML" enabled="true" patternSyntax="Wildcard">
<match filterByTags="A, Script" pattern="*%2fblog*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
<action type="Rewrite" value="{R:1}{R:2}" />
</rule>
<rule name="Rewritebp1" preCondition="IsHTML" enabled="true" patternSyntax="Wildcard">
<match filterByTags="A, Area, Base, Form, Img, Input, Link, Script" pattern="*/bp/*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<rule name="rewritebp2" preCondition="IsHTML" enabled="true" patternSyntax="Wildcard">
<match filterByTags="A, Script" pattern="*%2fbp*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
<action type="Rewrite" value="{R:1}{R:2}" />
</rule>
<rule name="Rewrite3" preCondition="IsHTML" enabled="true" patternSyntax="Wildcard">
<match filterByTags="CustomTags" customTags="javascripts" pattern="*/blog/*" />
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<rule name="Rewrite Location Header" preCondition="IsRedirectio n" patternSyntax="Wildcard">
<match serverVariable="RESPONSE_L ocation" pattern="*/blog/*" />
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<preConditions>
<preCondition name="IsHTML" patternSyntax="Wildcard">
<add input="{RESPONSE_CONTENT_T YPE}" pattern="*text/html*" />
</preCondition>
<preCondition name="IsRedirection" patternSyntax="Wildcard">
<add input="{RESPONSE_STATUS}" pattern="302" />
</preCondition>
</preConditions>
<customTags>
<tags name="javascripts">
<tag name="input" attribute="onkeypress" />
<tag name="input" attribute="onclick" />
</tags>
</customTags>
</outboundRules>
<rules>
<rule platformId="wdpVpr" name="www.bananapages.net virtual path rewrite" stopProcessing="true">
<match url="^.*$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.bananapages \.net$" />
</conditions>
<action type="Rewrite" url="/bp/{R:0}" appendQueryString="true" />
</rule>
<rule platformId="wdpVpr" name="bananapages.net virtual path rewrite" stopProcessing="true">
<match url="^.*$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^bananapages\.net $" />
</conditions>
<action type="Rewrite" url="/bp/{R:0}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<urlCompression doStaticCompression="false " />
</system.webServer>
</configuration>
I need help converting my web.config file into a .htaccess file.
I hope we can find some volenteers...
Here is contents of the web.config file....
Please help....
..DA for R
--------------------------
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<outboundRules>
<clear />
<rule name="www.bananapages.net virtual path rewrite">
<match serverVariable="RESPONSE_L
<conditions>
<add input="{RESPONSE_STATUS}" pattern="^301$" ignoreCase="false" />
</conditions>
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<rule name="bananapages.net virtual path rewrite">
<match serverVariable="RESPONSE_L
<conditions>
<add input="{RESPONSE_STATUS}" pattern="^301$" ignoreCase="false" />
</conditions>
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<rule name="Rewrite" preCondition="IsHTML" enabled="true" patternSyntax="Wildcard">
<match filterByTags="A, Area, Img, Input, Link, Script" pattern="*/blog/*" />
<conditions logicalGrouping="MatchAll"
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<rule name="rewrite2" preCondition="IsHTML" enabled="true" patternSyntax="Wildcard">
<match filterByTags="A, Script" pattern="*%2fblog*" />
<conditions logicalGrouping="MatchAll"
<action type="Rewrite" value="{R:1}{R:2}" />
</rule>
<rule name="Rewritebp1" preCondition="IsHTML" enabled="true" patternSyntax="Wildcard">
<match filterByTags="A, Area, Base, Form, Img, Input, Link, Script" pattern="*/bp/*" />
<conditions logicalGrouping="MatchAll"
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<rule name="rewritebp2" preCondition="IsHTML" enabled="true" patternSyntax="Wildcard">
<match filterByTags="A, Script" pattern="*%2fbp*" />
<conditions logicalGrouping="MatchAll"
<action type="Rewrite" value="{R:1}{R:2}" />
</rule>
<rule name="Rewrite3" preCondition="IsHTML" enabled="true" patternSyntax="Wildcard">
<match filterByTags="CustomTags" customTags="javascripts" pattern="*/blog/*" />
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<rule name="Rewrite Location Header" preCondition="IsRedirectio
<match serverVariable="RESPONSE_L
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<preConditions>
<preCondition name="IsHTML" patternSyntax="Wildcard">
<add input="{RESPONSE_CONTENT_T
</preCondition>
<preCondition name="IsRedirection" patternSyntax="Wildcard">
<add input="{RESPONSE_STATUS}" pattern="302" />
</preCondition>
</preConditions>
<customTags>
<tags name="javascripts">
<tag name="input" attribute="onkeypress" />
<tag name="input" attribute="onclick" />
</tags>
</customTags>
</outboundRules>
<rules>
<rule platformId="wdpVpr" name="www.bananapages.net virtual path rewrite" stopProcessing="true">
<match url="^.*$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.bananapages
</conditions>
<action type="Rewrite" url="/bp/{R:0}" appendQueryString="true" />
</rule>
<rule platformId="wdpVpr" name="bananapages.net virtual path rewrite" stopProcessing="true">
<match url="^.*$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^bananapages\.net
</conditions>
<action type="Rewrite" url="/bp/{R:0}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<urlCompression doStaticCompression="false
</system.webServer>
</configuration>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why did you present a "C" grade?
Accept http:#a39550892.
RewriteRule https?\://www\.bananapages
RewriteRule https?\://bananapages\.net
would take care of the first 2
i don't know of an equivalent for "match filterByTags" in apache nor does it feature ways to add headers in this way (but the added http_host headers don't seem very useful)
could you describe the functionalities you want rather than trying to convert file formats for software with little in common feature-wise ?