0

I am new to windows server and I'd usually used .htaccess file which is not working in a windows server. How can I enable .htaccess file in windows server.?

4
  • 3
    You are trolling us aren't you.
    – user9517
    Oct 18, 2017 at 5:05
  • Sorry. I didn't get you.. @user430214 Oct 18, 2017 at 5:08
  • Your answer has absolutely no relation to your question, so I'm assuming your question isn't well-formed.
    – womble
    Oct 19, 2017 at 2:09
  • @womble I'd end up with this solution. My question was how could I enable .htaccess in windows server. But adding web.config just resolved my issue. That is why I'd posted it here. Thank you for your mention. Oct 19, 2017 at 3:35

3 Answers 3

1

My friend helped me to resolve this issue. I was using the codeigniter framework and I'd used a web.config file instead .htaccess file.

web.config looks like:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                 <rule name="MyRule"> <match url="^(.*)$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php/{R:1}" appendQueryString="false" /> </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Also in my config.php just set uri_protocol to AUTO :

$config['uri_protocol'] = 'AUTO';
0

.htaccess files are Apache web server specific configuration files.

You have to install Apache in windows to use those configuration files.

1
  • I am recently using godaddy platform and shoud I install Apache in it.? sorry I am not aware of this issue before. @Vikelidis Kostas Oct 18, 2017 at 4:45
0

I am going to assume that you are using Microsoft's Internet Information Services (IIS) as your webserver.

A .htaccess file, like others have said, is something a part of the apache software - it just isn't a thing in IIS.

You didn't say what you wanted to do in the .htaccess and there isn't a direct equivalent in IIS but there are useful options in the IIS Manager.

Not the answer you're looking for? Browse other questions tagged .