Lim Guang Jian
Lim Guang Jian

Reputation: 90

What is wrong htaccess

I have the following htaccess rules but I dont know how to make it work:

RewriteEngine on 
RewriteRule ^game/([^/]*)$ index.php?cash=$1

The following is the screen shot of my folders structure:

enter image description here

Can someone tell me how to get it to work? I have also tried:

RewriteRule ^index.php([^/]*)$ index.php?cash=$1

The URL that I want to display is: http://localhost/biteep/game/100 while the URL that I want the browser to go to is http://localhost/biteep/game?cash=100

Upvotes: 1

Views: 40

Answers (2)

Lim Guang Jian
Lim Guang Jian

Reputation: 90

So it works when I do this

RewriteEngine on 
RewriteRule ^([0-9]+)$ index.php?cash=$1

Upvotes: 0

Milzer
Milzer

Reputation: 71

Try to put a rewrite base into your .htaccess:

RewriteBase /biteep/

And this route should be enough:

RewriteRule ^game\/(\d+)$ index.php?cash=$1

Upvotes: 1

Related Questions