I am trying to have domain.com/game/tetris rewrite to domain.com/game.php?keyword=tetris , but it doesn't seem to be working. My line of code is below. Can anyone see what I am doing wrong? RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^/game/(.*)$ /game.php?keyword=$1 [NC,L]
Here is what the .htaccess should contain to do the redirect you are requesting: RewriteEngine On RewriteRule ^game/(.*) /game.php?keyword=$1 [L] Code (markup): You can test that it is working by checking out this site: http://htaccess.madewithlove.be/
Thanks, it worked on the test page, but just not on my actual site. I even tried removing all other rewriterules and only using the code you wrote, but it still wont work. Its just not meant to be.
how about setting this to your htaccess Redirect 302 /domain.com/game/tetris/index.html http://www.domain.com/game.php?keyword=tetris
The only version of the code that will work is: RewriteEngine On RewriteRule ^(.*) /game.php?keyword=$1 [L] But if I add the /game/ subdirectory it doesn't work.