-1

This is my current .htaccess:

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?page=$1 [QSA,L]
RewriteRule ^games/(.*)$ index.php?page=games&game=$1 [L,QSA]

I need for this to work:

index.php?page=music should be url.com/music

index.php?page=games should be url.com/games

index.php?page=games&game=example should be url.com/games/example

Please help me write my .htaccess for this

Himanshu
  • 4,327
  • 16
  • 31
  • 39
  • And what is the problem with your current rules? Don't they work? What do or don't they do? – deceze Jul 03 '15 at 11:18

1 Answers1

0

try following

  Options +FollowSymlinks
    RewriteEngine on
    rewriterule ^index.php?page=music(.*)$ http://otherdomain.com/music$1 [r=301,nc]
rewriterule ^index.php?page=music(.*)$ http://otherdomain.com/music$1 [r=301,nc]
rewriterule ^index.php?page=games(.*)$ http://otherdomain.com/games$1 [r=301,nc]
rewriterule ^index.php?page=games&game=example(.*)$ http://otherdomain.com/games/example$1 [r=301,nc]
Thamaraiselvam
  • 6,961
  • 8
  • 45
  • 71