...

View Full Version : .htaccess to web.config conversion question



theflyingminstr
01-19-2012, 11:21 AM
Hi, I have the following .htaccess file:



RewriteRule ^album/(.*)\.html$ albums.php?album=$1 [L,NC]
RewriteRule ^album/(.*)/([0-9]*)$ albums.php?album=$1&page=$2 [L,NC]
RewriteRule ^([a-zA-Z0-9]*)/$ lyrics.php?letter=$1 [L,NC]
RewriteRule ^([a-zA-Z0-9]*)/([0-9]*)$ lyrics.php?letter=$1&page=$2 [L,NC]
RewriteRule ^lyrics/([0-9]*)/(.*)\.html$ viewlyrics.php?id=$1&title=$2 [L,NC]
RewriteRule ^singer/(.*)\.html$ singer.php?singer=$1 [L,NC]
RewriteRule ^singer/(.*)/([0-9]*)$ singer.php?singer=$1&page=$2 [L,NC]



I am trying to convert it to a web.config file but I'm getting 500 internal server errors



<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="album">
<match url="^album/(.*)\.html$" ignoreCase="true" />
<action type="Rewrite" url="albums.php?album=$1 [L,NC]" />
</rule>
<rule name="albums">
<match url="^album/(.*)/([0-9]*)$" ignoreCase="true" />
<action type="Rewrite" url="albums.php?album=$1&page=$2 [L,NC]" />
</rule>
<rule name="lyrics1">
<match url="^([a-zA-Z0-9]*)/$" ignoreCase="true" />
<action type="Rewrite" url="lyrics.php?letter=$1 [L,NC]" />
</rule>
<rule name="lyrics2">
<match url="^([a-zA-Z0-9]*)/([0-9]*)$" ignoreCase="true" />
<action type="Rewrite" url="lyrics.php?letter=$1&page=$2 [L,NC]" />
</rule>
<rule name="viewlyrics">
<match url="^lyrics/([0-9]*)/(.*)\.html$" ignoreCase="true" />
<action type="Rewrite" url="viewlyrics.php?id=$1&title=$2 [L,NC]" />
</rule>
<rule name="singer1">
<match url="^singer/(.*)\.html$" ignoreCase="true" />
<action type="Rewrite" url="singer.php?singer=$1 [L,NC]" />
</rule>
<rule name="singer2">
<match url="^singer/(.*)/([0-9]*)$" ignoreCase="true" />
<action type="Rewrite" url="singer.php?singer=$1&page=$2 [L,NC]" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>


- Thanks in advanced for any help with this.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum