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.?
- 3You are trolling us aren't you.user9517– user95172017-10-18 05:05:11 +00:00Commented Oct 18, 2017 at 5:05
- Sorry. I didn't get you.. @user430214Hanan Ashraf– Hanan Ashraf2017-10-18 05:08:25 +00:00Commented 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– womble ♦2017-10-19 02:09:20 +00:00Commented 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.Hanan Ashraf– Hanan Ashraf2017-10-19 03:35:40 +00:00Commented Oct 19, 2017 at 3:35
3 Answers
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'; .htaccess files are Apache web server specific configuration files.
You have to install Apache in windows to use those configuration files.
- I am recently using godaddy platform and shoud I install Apache in it.? sorry I am not aware of this issue before. @Vikelidis KostasHanan Ashraf– Hanan Ashraf2017-10-18 04:45:10 +00:00Commented Oct 18, 2017 at 4:45
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.