FrickX
FrickX

Reputation: 63

mod_rewrite works in Linux but not in Windows

Everyone knows the black magic of Apache and mod_rewrite...

Also I have a problem too...

I just downloaded Apache 2.4 from here https://www.apachelounge.com/download/win64/ and enabled mod_rewrite with this line

LoadModule rewrite_module modules/mod_rewrite.so

Output of httpd.exe -v

Server version: Apache/2.4.10 (Win64) Apache Lounge VC10 Server built: Jul 19 2014 12:25:58

My httpd.conf http://pastebin.com/TDHpurBi

And my .htaccess http://pastebin.com/f6KV3Zd2

The .htaccess is for my MVC-Framework

Thanks in advance for any help

PS: The .htaccess worked like a charm with

Server version: Apache/2.4.7 (Win32) Apache Lounge VC10 Server built: Nov 26 2013 15:46:56

from Uniserver

PS2: I forgot to say, that I got the .htaccess running under Linux with the enabled AllowOverride in httpd.conf. So it might be only a Apache-Windows-problem.

Upvotes: 3

Views: 1438

Answers (2)

Andrea Bisello
Andrea Bisello

Reputation: 1225

You have to consider alias and position of .htaccess

so, for example, if you have created an alias called "mywebsite" (so you will open http://localhost/mywebsite to reach the homepage) but you have .htaccess inside a subfolder, for example /api folder, you need to use this RewriteBase directive :

RewriteBase /mywebsite/api

and then restart apache

Upvotes: 1

Artem  Rusinov
Artem Rusinov

Reputation: 176

I solved this problem!

DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">

section!

And there set

AllowOverride All

this will solve your problem!

Upvotes: 1

Related Questions