Rewritecond Is Not Working

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

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

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.