RewriteCond is not working

In my .htaccess file

RewriteRule .* /test/index.php [L]

This code working fine on apache2 on ubuntu server.

But when I add this line

RewriteCond %{QUERY_STRING} foo

It's not working. It working fine on WAMP on windows

Linux ip-172-31-21-17 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Server version: Apache/2.4.7 (Ubuntu)

2

1 Answer

I figured solution after 6 hours. Someone please help me why it's like that

I enabled a2enmod with command sudo a2enmod rewrite after 6 hours of research I again tried to enable rewrite. This time fortunately I missed sudo and it started working.

Really confusing :(

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like