0

Hi guys I want to change this url: https://example.com/game.php?games=Final-Fantasy-XIV/ to this: https://example.com/game/Final-Fantasy-XIV/

  • 1
    Welcome. You need to do the [appropriate amount of research](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) and make some attempts yourself first. If you get stuck on something _specific_, post your attempt, explain where you're stuck, the expected result and what currently happens. We're here to help you with concrete issues with your current code, not to write it all for you (which a proper answer here would require us to) – M. Eriksson Nov 27 '21 at 12:19
  • Please read [how to create a minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) and [how to ask](https://stackoverflow.com/help/how-to-ask). You should also [take the tour](https://stackoverflow.com/tour) that was recommended to you when you registered. – M. Eriksson Nov 27 '21 at 12:20

2 Answers2

1

For the next time, please provide, what you already tried and do your amount of own research. However, this should work:

RewrtieEngine On
RewriteRule ^game/(.*)/$ /game.php?games=$1 [L,NC]
stui
  • 353
  • 3
  • 15
1

If you display url by name (text) then it should be as folowing

RewrtieEngine On
RewriteRule ^([a-zA-Z0-9_-]+)/$ game.php?games=$1 [L,NC] 

If you display url by id then it should be like this:

RewrtieEngine On
RewriteRule ^game/(.*)/$ game.php?games=$1 [L,NC]