使用.htaccess自定义URL或隐藏查询字符串

I am new one, I learn .htaccess. I want to customize my URL from index.php?page=mobile to index/page/mobile

I used this code but it doesn't work:

RewriteEngine on
RewriteRule    ^index/([0-9]+)/?$    index.php?page=$1    [NC,L]    # Handle product requests

and

RewriteEngine on
RewriteRule ^index/([^/.]+)/?$ index.php?page=$1 [L]

This rule should work:

RewriteEngine on
RewriteBase /cashearn/

RewriteCond %{THE_REQUEST} /index\.php\?page=([^\s&]+) [NC]
RewriteRule ^ index/page/%1? [R=302,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^index/page/([^/]+)/?$ index.php?page=$1 [L,QSA,NC]

This will let you have URL as http://domain.com/index/page/mobile on your page.

Try that code:

RewriteEngine on
RewriteBase /
RewriteRule ^index/page/([^/.]+)/?$ index.php?page=$1 [L,QSA,NC]

This should work - not tested though

RewriteRule ^index/page/([^/.]+)$ index.php?page=$1 [L,QSA,NC]