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.?

Hanan Ashraf
  • 119
  • 1
  • 4

3 Answers3

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';
Hanan Ashraf
  • 119
  • 1
  • 4
0

.htaccess files are Apache web server specific configuration files.

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

Vikelidis Kostas
  • 967
  • 1
  • 6
  • 16
  • I am recently using godaddy platform and shoud I install Apache in it.? sorry I am not aware of this issue before. @Vikelidis Kostas – Hanan Ashraf Oct 18 '17 at 04: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.