i have windows hosting and website is in php. So i asked the hosting company where i can find the .htaccess file. and they said there is no .htaccess file in windows hosting i have to use web.config file to do website configuration. I tried this simple code on my web.config but i got 500 - Internal server error. <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.web> </system.web> <rewrite> <rule name="rule 1c" stopProcessing="true"> <match url="^([a-zA-Z]+)$" /> <action type="Rewrite" url="/index.php?category={R:1}" appendQueryString="true" /> </rule> </rewrite> </configuration> Code (markup):
Looks like your XML syntax is incorrect give this a try: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="rule 1c" stopProcessing="true"> <match url="^([a-zA-Z]+)$" /> <action type="Rewrite" url="/index.php?category={R:1}" appendQueryString="true" /> </rule> </rules> </rewrite> </system.webServer> </configuration> Code (markup):
Yes windows doesn't use htaccess, my current web.config is like this, I would like to add url redirection from old url to new old and secondly i want to force site using http:// sitename.com instead of www version. How can i do this? I tried dealing with web hosting provider but they are not helping with this issue. <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <directoryBrowse enabled="false" /> <defaultDocument> <files> <clear /> <add value="index.html" /> <add value="Default.htm" /> <add value="Default.asp" /> <add value="index.htm" /> <add value="iisstart.htm" /> <add value="default.aspx" /> <add value="index.php" /> </files> </defaultDocument> <handlers> <add name="PHP" path="*.html" verb="*" modules="CgiModule" scriptProcessor="C:\PHP\php-cgi.exe" resourceType="Unspecified" /> </handlers> <httpErrors errorMode="DetailedLocalOnly"> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" /> </httpErrors> </system.webServer> </configuration>