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.?
Asked
Active
Viewed 7,744 times
0
-
3You are trolling us aren't you. – user9517 Oct 18 '17 at 05:05
-
Sorry. I didn't get you.. @user430214 – Hanan Ashraf Oct 18 '17 at 05:08
-
Your answer has absolutely no relation to your question, so I'm assuming your question isn't well-formed. – womble Oct 19 '17 at 02: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. – Hanan Ashraf Oct 19 '17 at 03:35
3 Answers
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.

Roadhog
- 1